« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/generateAlbumCoverArtwork.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/snapshot/generateAlbumCoverArtwork.js')
-rw-r--r--test/snapshot/generateAlbumCoverArtwork.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/snapshot/generateAlbumCoverArtwork.js b/test/snapshot/generateAlbumCoverArtwork.js
new file mode 100644
index 00000000..015838c7
--- /dev/null
+++ b/test/snapshot/generateAlbumCoverArtwork.js
@@ -0,0 +1,35 @@
+import t from 'tap';
+import {testContentFunctions} from '../lib/content-function.js';
+
+testContentFunctions(t, 'generateAlbumCoverArtwork (snapshot)', async (t, evaluate) => {
+  await evaluate.load();
+
+  const extraDependencies = {
+    getSizeOfImageFile: () => 0,
+  };
+
+  const album = {
+    directory: 'bee-forus-seatbelt-safebee',
+    coverArtFileExtension: 'png',
+    artTags: [
+      {name: 'Damara', directory: 'damara', isContentWarning: false},
+      {name: 'Cronus', directory: 'cronus', isContentWarning: false},
+      {name: 'Bees', directory: 'bees', isContentWarning: false},
+      {name: 'creepy crawlies', isContentWarning: true},
+    ],
+  };
+
+  evaluate.snapshot('display: primary', {
+    name: 'generateAlbumCoverArtwork',
+    args: [album],
+    slots: {displayMode: 'primary'},
+    extraDependencies,
+  });
+
+  evaluate.snapshot('display: thumbnail', {
+    name: 'generateAlbumCoverArtwork',
+    args: [album],
+    slots: {displayMode: 'thumbnail'},
+    extraDependencies,
+  });
+});