mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-19 16:24:51 +00:00
a1c8ac624f
There are still some whitespace and attribute ordering issues, but the result runs correctly.
29 lines
835 B
JavaScript
Executable File
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");
|
|
});
|
|
|
|
}); |