From 00ac5503d9f9855eaa6bbf622b9a75c0758c5889 Mon Sep 17 00:00:00 2001
From: Jeremy Ruston [
{
"title": "Payload Tiddler",
"tags": "Alpha Beta Gamma",
"text": "This is a payload tiddler from a compound tiddler",
"custom": "Alpha"
}
-]
-<$view tiddler="Output" format="plainwikified" mode="block"/>
+ <%else%>
+ <$transclude $tiddler="Output" $mode="block"/>
+ <%endif%>
<$data $compound-tiddler="Compound" custom="Alpha"/>
-
+
title: Compound
type: text/vnd.tiddlywiki-multiple
@@ -20,13 +19,11 @@ This is a payload tiddler from a compound tiddler
+
title: ExpectedResult
-
-[
+
<$data $filter="[prefix[Day: T]]" custom="Beta"/> -+ title: Day: Monday text: Today is Monday @@ -32,8 +31,7 @@ text: Today is Sunday + title: ExpectedResult -
-[ +\ No newline at end of file +] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/DataWidget/ImportedTiddler.tid b/editions/tw5.com/tiddlers/testcases/DataWidget/ImportedTiddler.tid index 88be0a4a7..e7ddeb83b 100644 --- a/editions/tw5.com/tiddlers/testcases/DataWidget/ImportedTiddler.tid +++ b/editions/tw5.com/tiddlers/testcases/DataWidget/ImportedTiddler.tid @@ -2,12 +2,11 @@ title: TestCases/DataWidget/ImportedTiddler type: text/vnd.tiddlywiki-multiple tags: [[$:/tags/wiki-test-spec]] description: Imported tiddler definition +display-format: plaintext title: Output -[ { "title": "Day: Thursday", "text": "Today is Thursday", @@ -44,5 +42,4 @@ title: ExpectedResult "text": "Today is Tuesday", "custom": "Beta" } -] -
<$data $tiddler="HelloThere" custom="Alpha"/> -+ title: HelloThere modifier: JoeBloggs @@ -16,13 +15,11 @@ This is the HelloThere tiddler + title: ExpectedResult -
-[ +\ No newline at end of file +] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/DataWidget/SimpleTiddler.tid b/editions/tw5.com/tiddlers/testcases/DataWidget/SimpleTiddler.tid index cc7a64585..ada31f811 100644 --- a/editions/tw5.com/tiddlers/testcases/DataWidget/SimpleTiddler.tid +++ b/editions/tw5.com/tiddlers/testcases/DataWidget/SimpleTiddler.tid @@ -2,20 +2,17 @@ title: TestCases/DataWidget/SimpleTiddler type: text/vnd.tiddlywiki-multiple tags: [[$:/tags/wiki-test-spec]] description: Simple tiddler definition +display-format: plaintext title: Output -[ { "title": "HelloThere", "modifier": "JoeBloggs", "text": "This is the HelloThere tiddler", "custom": "Alpha" } -] -
<$data title="Epsilon" text="Theta"/> -+ title: ExpectedResult -
-[ +\ No newline at end of file +] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid b/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid index faf488c4b..2369ed500 100644 --- a/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid @@ -29,6 +29,8 @@ If the test fails, a red cross is shown, and there is a display of the differenc The <<.wid testcase>> widget can be used directly as documented below, but it is generally easier and more flexible to create [[TestCaseTiddlers]]. These are special, self contained tiddlers that can contain multiple payload tiddlers making up a testcase. +Note that the testcase wiki will inherit variables that are visible to the <<.wid testcase>> widget itself. + ! Limitations The <<.wid testcase>> widget creates a lightweight TiddlyWiki environment that is a parasite of the main wiki. Because it is not a full, independent TiddlyWiki environment, there are some important limitations: @@ -57,7 +59,15 @@ The payload tiddlers are the tiddler values that are loaded into the subwiki tha ! Testcase Templates -The <<.attr template>> attribute defaults to $:/core/ui/testcases/DefaultTemplate but can be used to specify a custom template for special purposes. The provided template $:/core/ui/testcases/RawJSONTemplate can be used for debugging purposes to display all of the payload widgets in JSON. +The <<.attr template>> attribute defaults to $:/core/ui/testcases/DefaultTemplate + +The default template uses several variables that can be set by the user: + +|!Variable |!Description | +|<<.var linkTarget>> |Causes the testcase description to be rendered as a link to the current tiddler | +|<<.var displayFormat>> |Defaults to "wikitext", can also be "plaintext" to force plain text display | + +A custom template can be specified for special purposes. For example, the provided template $:/core/ui/testcases/RawJSONTemplate just displays the payload tiddlers in JSON, which can be used for debugging purposes. ! Testcase Template Variables[ { "title": "Epsilon", "text": "Theta" } -] -