-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the testcase widget for the $reveal widget examples (#8406)
* Use the testcase widget for the $reveal widget examples * Convert $reveal testcase widget examples into testcase tiddlers * Add expected results to $reveal test case tiddlers These examples are intended to be interactive and the expect results only test the initial rendering. Still that seems like useful verification
- Loading branch information
Showing
5 changed files
with
112 additions
and
52 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
editions/tw5.com/tiddlers/testcases/RevealWidget/AccordionSlider.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
created: 20240721163229297 | ||
description: Reveal widget for accordion or slider functionality | ||
modified: 20240721172211283 | ||
tags: $:/tags/wiki-test-spec | ||
title: TestCases/RevealWidget/AccordionSlider | ||
type: text/vnd.tiddlywiki-multiple | ||
|
||
title: Narrative | ||
|
||
Two distinct buttons toggle the state of the tiddler value. Two reveal widgets. The first displays the button to show the content. The second displays both the content and the button to hide the content. | ||
+ | ||
title: Output | ||
|
||
<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show"> | ||
|
||
<$button set="$:/state/SampleReveal2" setTo="show">Show me</$button> | ||
|
||
</$reveal> | ||
<$reveal type="match" state="$:/state/SampleReveal2" text="show"> | ||
|
||
<$button set="$:/state/SampleReveal2" setTo="hide">Hide me</$button> | ||
|
||
! This is the revealed content | ||
And this is some text | ||
|
||
</$reveal> | ||
+ | ||
title: ExpectedResult | ||
|
||
<div class=" tc-reveal"><p><button class="">Show me</button></p></div><div class=" tc-reveal" hidden="true"></div> |
27 changes: 27 additions & 0 deletions
27
editions/tw5.com/tiddlers/testcases/RevealWidget/Popup.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
created: 20240721163229297 | ||
description: Reveal widget for popup content | ||
modified: 20240721172211283 | ||
tags: $:/tags/wiki-test-spec | ||
title: TestCases/RevealWidget/Popup | ||
type: text/vnd.tiddlywiki-multiple | ||
|
||
title: Narrative | ||
|
||
When the button is clicked, the tiddler specified by the popup attribute is filled with the click coordinates. The reveal widget uses these coordinates to position the popup content. | ||
+ | ||
title: Output | ||
|
||
<$button popup="$:/SamplePopupState">Pop me up!</$button> | ||
|
||
<$reveal type="popup" state="$:/SamplePopupState"> | ||
<div class="tc-drop-down"> | ||
|
||
! This is the popup | ||
And this is some text | ||
|
||
</div> | ||
</$reveal> | ||
+ | ||
title: ExpectedResult | ||
|
||
<p><button aria-expanded="false" class="">Pop me up!</button></p><p><span class=" tc-reveal" hidden="true"></span></p> |
27 changes: 27 additions & 0 deletions
27
editions/tw5.com/tiddlers/testcases/RevealWidget/SimpleReveal.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
created: 20240721163229297 | ||
description: Simple content reveal | ||
modified: 20240721172211283 | ||
tags: $:/tags/wiki-test-spec | ||
title: TestCases/RevealWidget/SimpleReveal | ||
type: text/vnd.tiddlywiki-multiple | ||
|
||
title: Narrative | ||
|
||
Two distinct buttons toggle the state of the tiddler value. The reveal widget displays its content for one of the two states. | ||
+ | ||
title: Output | ||
|
||
<$button set="$:/state/SampleReveal1" setTo="show">Show me</$button> | ||
<$button set="$:/state/SampleReveal1" setTo="hide">Hide me</$button> | ||
|
||
<$reveal type="match" state="$:/state/SampleReveal1" text="show"> | ||
|
||
! This is the revealed content | ||
And this is some text | ||
|
||
</$reveal> | ||
+ | ||
title: ExpectedResult | ||
|
||
<p><button class="">Show me</button> | ||
<button class="">Hide me</button></p><div class=" tc-reveal" hidden="true"></div> |
23 changes: 23 additions & 0 deletions
23
editions/tw5.com/tiddlers/testcases/RevealWidget/TextReference.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
created: 20240721163229297 | ||
description: Reveal widget text references | ||
modified: 20240721174826529 | ||
tags: $:/tags/wiki-test-spec | ||
title: TestCases/RevealWidget/TextReference | ||
type: text/vnd.tiddlywiki-multiple | ||
|
||
title: Narrative | ||
|
||
The state attribute of the reveal widget can use the text reference syntax to refer to a specific field. In this example if the field ``jeremy`` contains the text ``tiddlywiki``, then the reveal widget's content will be displayed. | ||
+ | ||
title: Output | ||
jeremy: tiddlywiki | ||
|
||
<$reveal type="match" state="!!jeremy" text="tiddlywiki"> | ||
~TiddlyWiki! | ||
</$reveal> | ||
+ | ||
title: ExpectedResult | ||
|
||
<p><span class=" tc-reveal"> | ||
TiddlyWiki! | ||
</span></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters