mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-18 23:31:25 -08:00
Minor improvement to unit tests
This commit is contained in:
parent
88854720f5
commit
b4e512760e
1 changed files with 4 additions and 7 deletions
|
|
@ -827,26 +827,24 @@ describe("Widget module", function() {
|
|||
* Test data for checkbox widget tests
|
||||
*/
|
||||
|
||||
const checkboxTestTiddlers = [
|
||||
{title: "TiddlerOne", text: "Jolly Old World", expand: "yes"},
|
||||
{title: "TiddlerTwo", text: "Jolly Old World", expand: "no"},
|
||||
];
|
||||
|
||||
const checkboxTestData = [
|
||||
{
|
||||
testName: "field mode checked",
|
||||
tiddlers: [{title: "TiddlerOne", text: "Jolly Old World", expand: "yes"}],
|
||||
widgetText: "<$checkbox tiddler='TiddlerOne' field='expand' checked='yes' />",
|
||||
startsOutChecked: true,
|
||||
expectedChange: { "TiddlerOne": { expand: undefined } }
|
||||
},
|
||||
{
|
||||
testName: "field mode unchecked",
|
||||
tiddlers: [{title: "TiddlerTwo", text: "Jolly Old World", expand: "no"}],
|
||||
widgetText: "<$checkbox tiddler='TiddlerTwo' field='expand' unchecked='no' />",
|
||||
startsOutChecked: false,
|
||||
expectedChange: { "TiddlerTwo": { expand: undefined } }
|
||||
},
|
||||
{
|
||||
testName: "field mode toggle",
|
||||
tiddlers: [{title: "TiddlerTwo", text: "Jolly Old World", expand: "no"}],
|
||||
widgetText: "<$checkbox tiddler='TiddlerTwo' field='expand' checked='yes' unchecked='no' />",
|
||||
startsOutChecked: false,
|
||||
expectedChange: { "TiddlerTwo": { expand: "yes" } }
|
||||
|
|
@ -1063,8 +1061,7 @@ describe("Widget module", function() {
|
|||
// Create the wiki
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add test tiddlers
|
||||
wiki.addTiddlers(checkboxTestTiddlers);
|
||||
if(data.tiddlers) wiki.addTiddlers(data.tiddlers);
|
||||
wiki.addTiddlers(data.tiddlers);
|
||||
// Construct the widget node
|
||||
var widgetNode = createWidgetNode(parseText(data.widgetText,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue