jQuery(document).ready(function(){ module("TW21Saver"); test("Saving tests", function() { var store = new TiddlyWiki(); var saver = store.getSaver(); var tiddler = new Tiddler("test"); tiddler.text = ""; tiddler.created = version.date; tiddler.modified = tiddler.created; var actual = saver.externalizeTiddler(store,tiddler); var expected = "
\n
\n
"; ok(actual==expected,'Saving empty tiddler with no dates'); delete tiddler; tiddler = new Tiddler("test"); tiddler.text = ""; tiddler.created = new Date(Date.UTC(2008,3,16,12,34)); tiddler.modified = tiddler.created; actual = saver.externalizeTiddler(store,tiddler); expected = "
\n
\n
"; ok(actual==expected,'Saving empty tiddler with created date'); delete tiddler; tiddler = new Tiddler("test"); tiddler.text = ""; tiddler.created = new Date(Date.UTC(2008,3,16,12,34)); tiddler.modified = new Date(Date.UTC(2008,3,17,12,34)); actual = saver.externalizeTiddler(store,tiddler); expected = "
\n
\n
"; ok(actual==expected,'Saving empty tiddler with created and modified dates'); delete tiddler; tiddler = new Tiddler("test"); tiddler.text = "text"; tiddler.created = version.date; tiddler.modified = tiddler.created; actual = saver.externalizeTiddler(store,tiddler); expected = "
\n
text
\n
"; ok(actual==expected,'Saving tiddler with text'); }); });