« get me outta code hell

data steps: linkTemplate snapshot tests - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-03-26 08:42:14 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-03-26 08:42:14 -0300
commit4e6f3c16818d9beb200c337d48c8ae2470a322ee (patch)
treeb05bc1f5df177572bdf61eb32d0c34823d010ce1 /test
parent5dfdb661c4672bcf432c9bd283a2ffec5a3c1cb3 (diff)
data steps: linkTemplate snapshot tests
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/linkTemplate.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/snapshots/linkTemplate.js b/test/snapshots/linkTemplate.js
new file mode 100644
index 0000000..0dcf5b6
--- /dev/null
+++ b/test/snapshots/linkTemplate.js
@@ -0,0 +1,28 @@
+import t from 'tap';
+
+import {testContentFunctions} from './_support.js';
+
+testContentFunctions(t, 'linkTemplate', (t, evaluate) => {
+  evaluate.snapshot({
+    name: 'linkTemplate',
+    extraDependencies: {
+      getColors: c => ({primary: c + 'ff', dim: c + '77'}),
+    },
+  },
+    v => v
+      .slot('color', '#123456')
+      .slot('href', 'https://hsmusic.wiki/media/cool file.pdf')
+      .slot('hash', 'fooey')
+      .slot('attributes', {class: 'dog', id: 'cat1'})
+      .slot('content', 'My Cool Link'));
+
+  evaluate.snapshot({
+    name: 'linkTemplate',
+    extraDependencies: {
+      to: (...path) => '/c*lzone/' + path.join('/') + '/',
+      appendIndexHTML: true,
+    },
+  },
+    v => v
+      .slot('path', ['myCoolPath', 'ham', 'pineapple', 'tomato']));
+});