1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 01:50:28 +00:00

Merge pull request #1430 from tobibeer/1378-tests-sorting-unlisted-tiddlers

update tagging filter tests
This commit is contained in:
Jeremy Ruston 2015-01-28 13:16:24 +00:00
commit 040ed56de5

View File

@ -33,13 +33,13 @@ describe("Filter tests", function() {
tiddler: new $tw.Tiddler({title: "TiddlerSeventh", tiddler: new $tw.Tiddler({title: "TiddlerSeventh",
text: "", text: "",
list: "TiddlerOne [[Tiddler Three]] [[a fourth tiddler]] MissingTiddler", list: "TiddlerOne [[Tiddler Three]] [[a fourth tiddler]] MissingTiddler",
tags: [] tags: ["one"]
}), }),
}, },
"Tiddler8": { "Tiddler8": {
tiddler: new $tw.Tiddler({title: "Tiddler8", tiddler: new $tw.Tiddler({title: "Tiddler8",
text: "Tidd", text: "Tidd",
tags: [], tags: ["one"],
"test-field": "JoeBloggs" "test-field": "JoeBloggs"
}) })
} }
@ -162,11 +162,11 @@ describe("Filter tests", function() {
}); });
it("should handle the tagging operator", function() { it("should handle the tagging operator", function() {
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne"); expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,Tiddler8,TiddlerOne,TiddlerSeventh");
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne"); expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three"); expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
var fakeWidget = {getVariable: function() {return "one";}}; var fakeWidget = {getVariable: function() {return "one";}};
expect(wiki.filterTiddlers("[all[current]tagging[]sort[title]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne"); expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
}); });
it("should handle the untagged operator", function() { it("should handle the untagged operator", function() {