1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 11:29:58 +00:00
TiddlyWiki5/tw2/source/tiddlywiki/test/js/Options.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

29 lines
835 B
JavaScript
Executable File

jQuery(document).ready(function(){
var numSaves, _autoSaveChanges;
module("TiddlyWiki options", {
setup: function() {
config.options.chkAutoSave = true;
systemSettingSave = 0;
_autoSaveChanges = autoSaveChanges;
numSaves = 0;
autoSaveChanges = function() {
numSaves += 1;
return _autoSaveChanges.apply(this, arguments);
}
},
teardown: function() {
numSaves = null;
config.options.chkAutoSave = false;
autoSaveChanges = _autoSaveChanges;
}
});
test("save multiple system settings", function() {
saveSystemSetting("foo", true);
saveSystemSetting("foo", false);
saveSystemSetting("foo", true);
strictEqual(numSaves, 0, "The save is asynchronous so no saves have yet been made");
strictEqual(systemSettingSave > 0, true, "However there should be a timeout in progress");
});
});