« get me outta code hell

test: generateContributionLinks -> linkContribution - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/linkContribution.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-13 12:54:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-13 12:54:20 -0300
commitba41071d9b6647b2e12a78de774a55aef5b87876 (patch)
tree434759eb6bb9d45a96995bbefbaef003a3d79990 /test/snapshot/linkContribution.js
parent2ce5ddd844603b1c3d8f220a12603677104b7545 (diff)
test: generateContributionLinks -> linkContribution
Diffstat (limited to 'test/snapshot/linkContribution.js')
-rw-r--r--test/snapshot/linkContribution.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js
new file mode 100644
index 0000000..758fa26
--- /dev/null
+++ b/test/snapshot/linkContribution.js
@@ -0,0 +1,54 @@
+import t from 'tap';
+import {testContentFunctions} from '../lib/content-function.js';
+
+testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => {
+  const who1 = {
+    name: 'Clark Powell',
+    directory: 'clark-powell',
+    urls: ['https://soundcloud.com/plazmataz'],
+  };
+
+  const who2 = {
+    name: 'Grounder & Scratch',
+    directory: 'the-big-baddies',
+    urls: [],
+  };
+
+  const who3 = {
+    name: 'Toby Fox',
+    directory: 'toby-fox',
+    urls: ['https://tobyfox.bandcamp.com/', 'https://toby.fox/'],
+  };
+
+  const what1 = null;
+  const what2 = 'Snooping';
+  const what3 = 'Arrangement';
+
+  await evaluate.load();
+
+  const quickSnapshot = (message, slots) =>
+    evaluate.snapshot(message, {
+      name: 'linkContribution',
+      multiple: [
+        {args: [who1, what1]},
+        {args: [who2, what2]},
+        {args: [who3, what3]},
+      ],
+      slots,
+    });
+
+  quickSnapshot('showContribution & showIcons', {
+    showContribution: true,
+    showIcons: true,
+  });
+
+  quickSnapshot('only showContribution', {
+    showContribution: true,
+  });
+
+  quickSnapshot('only showIcons', {
+    showIcons: true,
+  });
+
+  quickSnapshot('no accents', {});
+});