mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-01 10:28:03 +00:00
Fix tests broken in 1b6e8e1a79
This commit is contained in:
@@ -34,23 +34,22 @@ describe("Wiki-based tests", function() {
|
|||||||
if(!wiki.tiddlerExists("Output")) {
|
if(!wiki.tiddlerExists("Output")) {
|
||||||
throw "Missing 'Output' tiddler";
|
throw "Missing 'Output' tiddler";
|
||||||
}
|
}
|
||||||
if(!wiki.tiddlerExists("ExpectedResult")) {
|
if(wiki.tiddlerExists("ExpectedResult")) {
|
||||||
throw "Missing 'ExpectedResult' tiddler";
|
// Construct the widget node
|
||||||
|
var text = "{{Output}}\n\n";
|
||||||
|
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||||
|
// Render the widget node to the DOM
|
||||||
|
var wrapper = renderWidgetNode(widgetNode);
|
||||||
|
// Clear changes queue
|
||||||
|
wiki.clearTiddlerEventQueue();
|
||||||
|
// Run the actions if provided
|
||||||
|
if(wiki.tiddlerExists("Actions")) {
|
||||||
|
widgetNode.invokeActionString(wiki.getTiddlerText("Actions"));
|
||||||
|
refreshWidgetNode(widgetNode,wrapper);
|
||||||
|
}
|
||||||
|
// Test the rendering
|
||||||
|
expect(wrapper.innerHTML).toBe(wiki.getTiddlerText("ExpectedResult"));
|
||||||
}
|
}
|
||||||
// Construct the widget node
|
|
||||||
var text = "{{Output}}\n\n";
|
|
||||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
|
||||||
// Render the widget node to the DOM
|
|
||||||
var wrapper = renderWidgetNode(widgetNode);
|
|
||||||
// Clear changes queue
|
|
||||||
wiki.clearTiddlerEventQueue();
|
|
||||||
// Run the actions if provided
|
|
||||||
if(wiki.tiddlerExists("Actions")) {
|
|
||||||
widgetNode.invokeActionString(wiki.getTiddlerText("Actions"));
|
|
||||||
refreshWidgetNode(widgetNode,wrapper);
|
|
||||||
}
|
|
||||||
// Test the rendering
|
|
||||||
expect(wrapper.innerHTML).toBe(wiki.getTiddlerText("ExpectedResult"));
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user