From 0a2b0b38a43ad1e1197d708d52f7e9b8425fea83 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Thu, 27 Apr 2023 18:01:16 +0100 Subject: [PATCH] Testcase docs update --- .../widgets/TestCaseTranscludeWidget.tid | 18 ----------------- .../tiddlers/widgets/TestCaseViewWidget.tid | 18 ----------------- .../tiddlers/widgets/TestCaseWidget.tid | 20 +++---------------- 3 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/widgets/TestCaseTranscludeWidget.tid delete mode 100644 editions/tw5.com/tiddlers/widgets/TestCaseViewWidget.tid diff --git a/editions/tw5.com/tiddlers/widgets/TestCaseTranscludeWidget.tid b/editions/tw5.com/tiddlers/widgets/TestCaseTranscludeWidget.tid deleted file mode 100644 index d992688fa..000000000 --- a/editions/tw5.com/tiddlers/widgets/TestCaseTranscludeWidget.tid +++ /dev/null @@ -1,18 +0,0 @@ -caption: testcase-transclude -created: 20230406161341763 -modified: 20230406161341763 -tags: Widgets -title: TestCaseTranscludeWidget -type: text/vnd.tiddlywiki - -! Introduction - -The testcase-transclude widget transcludes a tiddler from the subwiki established by an ancestor <<.wlink TestCaseWidget>> widget. - -! Content and Attributes - -The content of the `<$testcase-transcliude>` widget is not displayed. - -|!Attribute |!Description | -|<<.attr tiddler>> |Title of the tiddler to be transcluded | -|<<.attr mode>> |Optional parsing mode: "block" (the default) or "inline" | diff --git a/editions/tw5.com/tiddlers/widgets/TestCaseViewWidget.tid b/editions/tw5.com/tiddlers/widgets/TestCaseViewWidget.tid deleted file mode 100644 index b4274eafa..000000000 --- a/editions/tw5.com/tiddlers/widgets/TestCaseViewWidget.tid +++ /dev/null @@ -1,18 +0,0 @@ -caption: testcase-view -created: 20230406161341763 -modified: 20230406161341763 -tags: Widgets -title: TestCaseViewWidget -type: text/vnd.tiddlywiki - -! Introduction - -The testcase-transclude widget displays the raw text of a tiddler from the subwiki established by an ancestor <<.wlink TestCaseWidget>> widget. - -! Content and Attributes - -The content of the `<$testcase-view>` widget is not displayed. - -|!Attribute |!Description | -|<<.attr tiddler>> |Title of the tiddler to be displayed | -|<<.attr field>> |Optional field to be displayed (defaults to "text") | diff --git a/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid b/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid index 3fd3ea939..a9b24870f 100644 --- a/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/TestCaseWidget.tid @@ -7,7 +7,7 @@ type: text/vnd.tiddlywiki ! Introduction -The testcase widget creates an independent subwiki loaded with specified tiddlers and then renders a template that can display and render tiddlers from within the subwiki. This makes it possible to run independent tests that also serve as documentation examples. +The testcase widget creates an independent subwiki loaded with the specified payload tiddlers and then renders a specified template from within the subwiki.The default template displays a split view with the source tiddlers on the left and the rendered tiddler titled `Output` on the right. It also displays the tiddler titled `Description` as the heading. This makes it possible to run independent tests that also serve as documentation examples. ! Content and Attributes @@ -16,27 +16,13 @@ The content of the `<$testcase>` widget is not displayed but instead is scanned |!Attribute |!Description | |<<.attr template>> |Optional title of the template used to display the testcase (defaults to $:/core/ui/testcases/DefaultTemplate) | -! State Handling - -The `<$testcase>` widget sets the variable `transclusion` to a hash that reflects the names and values of all the payload tiddlers. This makes easier for test case templates to create unique state tiddler titles using the [[qualify Macro]] or QualifyWidget. - ! Payload Tiddlers The payload tiddlers are the tiddler values that are loaded into the subwiki that is created to run the tests. They are created via <<.wlink DataWidget>> widgets within the body of the `<$testcase>` widget. -! Test Case Templates +! State Handling -The test case template specified in the <<.attr template>> attribute can display and render tiddlers from the subwiki using the <<.wlink TestCaseTranscludeWidget>> and <<.wlink TestCaseViewWidget>> widgets. - -The default test case template $:/core/ui/testcases/DefaultTemplate displays a split view with the source tiddlers on the left and the rendered tiddler titled `Output` on the right. It also displays the tiddler titled `Description` as the heading. - -The `<$testcase>` widget assigns a value to the `transclusion` variable that depends on the combined values of all the payload tiddlers. This means that using the `<>` macro within a test case template will generate a unique value for each of multiple test cases within the same tiddler. - -! Test Case Variables - -The `<$testcase>` widget also assigns a block of information about the subwiki in JSON format to a the variable `testcaseInfo`. It contains the following properties: - -* ''tiddlers'': a hashmap by title of an array of all the field names of each tiddler in the subwiki (does not include shadow tiddlers unless they have been overridden) +The `<$testcase>` widget sets the variable `transclusion` to a hash that reflects the names and values of all the payload tiddlers. This makes easier for test case templates to create unique state tiddler titles using the [[qualify Macro]] or QualifyWidget. ! Test Case Conventions