1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-08 02:49:56 +00:00
TiddlyWiki5/tw2/source/tiddlywiki/test/js/Zoomer.js
Jeremy Ruston a1c8ac624f Added first pass at support for building TiddlyWiki 2.6.x with TW5
There are still some whitespace and attribute ordering issues, but the
result runs correctly.
2012-05-29 22:02:38 +01:00

33 lines
945 B
JavaScript
Executable File

jQuery(document).ready(function(){
module("Zoomer");
test("Zoomer functions", function() {
var zoomer_elem = document.body.appendChild(document.createElement("div"));
var zoomer_text = "hi!";
var actual = new Zoomer(zoomer_text,zoomer_elem,zoomer_elem);
ok(actual,'it should return a Morpher object');
delete zoomer_elem;
delete zoomer_text;
zoomer_elem = document.body.appendChild(document.createElement("div"));
zoomer_text = "hi!";
var before = document.body.childNodes.length;
var z = new Zoomer(zoomer_text,zoomer_elem,zoomer_elem);
var after = document.body.childNodes.length;
actual = after - before;
var expected = 1;
same(actual,expected,'it should create a div as child of the body');
actual = document.body.childNodes[document.body.childNodes.length-1].nodeName;
expected = "DIV";
same(actual,expected,'it should create a div with the class of "zoomer"');
delete zoomer_elem;
delete zoomer_text;
});
});