1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-17 17:34:48 +00:00
TiddlyWiki5/editions/test/tiddlers/tests/test-fakedom.js
2024-05-21 22:02:37 +01:00

28 lines
762 B
JavaScript

/*\
title: test-fakedom.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests the fakedom that Tiddlywiki occasionally uses.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
describe("fakedom tests", function() {
it("properly assigns nodeType based on DOM standards", function() {
// According to MDN, ELEMENT_NODE == 1 && TEXT_NODE == 3
// There are others, but currently they're not implemented in fakedom
expect($tw.fakeDocument.createElement("div").nodeType).toBe(1);
expect($tw.fakeDocument.createElement("div").ELEMENT_NODE).toBe(1);
expect($tw.fakeDocument.createTextNode("text").nodeType).toBe(3);
expect($tw.fakeDocument.createTextNode("text").TEXT_NODE).toBe(3);
});
});
})();