1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-04 04:43:52 +00:00

Start adding tests for palette operations

This commit is contained in:
Jeremy Ruston 2025-01-25 17:28:00 +00:00
parent 0fd5b04b9a
commit 8957424e55
2 changed files with 48 additions and 1 deletions

View File

@ -34,6 +34,7 @@ tags: $:/tags/Macro
\end actions-compile-palette-wikified
\procedure actions-compile-palette(inputTitle,outputTitle,defaultImport="$:/palettes/Vanilla")
\procedure tv-action-refresh-policy() always
<$let
tempPalette="$:/temp/palette-source"
>
@ -63,6 +64,7 @@ tags: $:/tags/Macro
\end actions-compile-palette
\procedure actions-recompile-current-palette()
\procedure tv-action-refresh-policy() always
<$transclude $variable="actions-compile-palette" inputTitle={{$:/palette}} outputTitle="$:/temp/palette-colours"/>
\end actions-recompile-current-palette
@ -70,7 +72,7 @@ tags: $:/tags/Macro
\procedure tv-action-refresh-policy() always
<$action-deletetiddler $tiddler="$:/temp/palette-colours"/>
<$action-setfield $tiddler="$:/palette" $field="text" $value=<<paletteTitle>>/>
<$transclude $variable="actions-compile-palette" inputTitle=<<paletteTitle>> outputTitle="$:/temp/palette-colours"/>
<<actions-recompile-current-palette>>
\end actions-switch-colour-palette
\procedure tv-palette-name() $:/temp/palette-colours

View File

@ -0,0 +1,45 @@
title: Operators/Palettes/BasicLookup
description: Compute the
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\import [subfilter{$:/core/config/GlobalImportFilter}]
<<colour page-background>>
<<colour background>>
+
title: Actions
\import [subfilter{$:/core/config/GlobalImportFilter}]
<<actions-recompile-current-palette>>
+
title: $:/palette
MyPalette
+
title: MyPalette
name: My Palette
description: My custom palette
tags: $:/tags/Palette
type: application/x-tiddler-dictionary
palette-import: MyOtherPalette
color-scheme: light
page-background: <<colour custom>>
custom: #f4e4d4
+
title: MyOtherPalette
name: My Other Palette
description: My other custom palette
tags: $:/tags/Palette
type: application/x-tiddler-dictionary
color-scheme: light
page-background: #d4e4f4
background: red
+
title: ExpectedResult
<p>#f4e4d4</p><p>red</p>