1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 06:44:50 +00:00
TiddlyWiki5/core/ui/TestCases/DefaultTemplate.tid

65 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

2023-10-26 15:56:15 +00:00
title: $:/core/ui/testcases/DefaultTemplate
\whitespace trim
\procedure linkcatcherActions()
<%if [<navigateTo>has[title]] %>
2024-05-08 17:03:16 +00:00
<$qualify title=<<state>> name="qualifiedState">
<$action-setfield $tiddler=<<qualifiedState>> text=<<navigateTo>>/>
</$qualify>
<%endif%>
\end
2023-10-26 15:56:15 +00:00
<$let
state={{{ [<qualify "$:/state/testcase">] }}}
>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-wrapper">
<div class="tc-test-case-header">
<h2>
<$genesis $type={{{ [<linkTarget>!match[]then[$link]else[div]] }}}>
<%if [<testResult>!match[]] %>
2024-05-09 07:16:30 +00:00
<span class={{{ tc-test-case-result-icon [<testResult>!match[fail]then[tc-test-case-result-icon-pass]] [<testResult>match[fail]then[tc-test-case-result-icon-fail]] +[join[ ]] }}}>
<%if [<testResult>!match[fail]] %>
{{$:/core/images/done-button}}
<%else%>
{{$:/core/images/close-button}}
<%endif%>
</span>
<%endif%>
<$view tiddler="Description" mode="inline"/>
</$genesis>
</h2>
</div>
<%if [[Narrative]is[tiddler]] %>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-narrative">
<$transclude $tiddler="Narrative" mode="block"/>
</div>
<%endif%>
<%if [<testResult>match[fail]] %>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-result-fail">
<div class="tc-test-case-result-fail-header">
2024-05-05 21:25:55 +00:00
TEST FAILED
</div>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-result-fail-body">
2024-05-05 21:25:55 +00:00
<$diff-text source=<<expectedHTML>> dest=<<outputHTML>>/>
</div>
</div>
<%endif%>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-panes">
<div class="tc-test-case-source">
<$macrocall $name="tabs" tabsList="[all[tiddlers]sort[]] -[prefix<state>] -Description -Narrative -ExpectedResult -Output Output +[putfirst[]] -[has[plugin-type]]" state=<<state>> default="Output" template="$:/core/ui/testcases/DefaultTemplate/SourceTabs"/>
</div>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-divider">
</div>
2024-05-09 07:16:30 +00:00
<div class="tc-test-case-output">
<%if [<displayFormat>!match[]else[wikitext]match[plaintext]] %>
<pre><$view tiddler="Output" format="plainwikified" mode="block"/></pre>
<%else%>
<$linkcatcher actions=<<linkcatcherActions>>>
<$transclude $tiddler="Output" $mode="block"/>
</$linkcatcher>
<%endif%>
</div>
</div>
</div>
2023-10-26 15:56:15 +00:00
</$let>