« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/snapshot/image.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/snapshot/image.js b/test/snapshot/image.js
index 48dcfb69..8608ab69 100644
--- a/test/snapshot/image.js
+++ b/test/snapshot/image.js
@@ -4,15 +4,17 @@ import {testContentFunctions} from '#test-lib';
 testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
   await evaluate.load();
 
-  const quickSnapshot = (message, opts) =>
+  const quickSnapshot = (message, {extraDependencies, ...opts}) =>
     evaluate.snapshot(message, {
       name: 'image',
       extraDependencies: {
+        checkIfImagePathHasCachedThumbnails: path => !path.endsWith('.gif'),
         getSizeOfImagePath: () => 0,
         getDimensionsOfImagePath: () => [600, 600],
         getThumbnailEqualOrSmaller: () => 'medium',
         getThumbnailsAvailableForDimensions: () =>
           [['large', 800], ['medium', 400], ['small', 250]],
+        ...extraDependencies,
       },
       ...opts,
     });
@@ -106,6 +108,7 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
   evaluate.snapshot('thumbnail details', {
     name: 'image',
     extraDependencies: {
+      checkIfImagePathHasCachedThumbnails: () => true,
       getSizeOfImagePath: () => 0,
       getDimensionsOfImagePath: () => [900, 1200],
       getThumbnailsAvailableForDimensions: () =>
@@ -117,4 +120,11 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
       path: ['media.albumCover', 'beyond-canon', 'png'],
     },
   });
+
+  quickSnapshot('thumb requested but source is gif', {
+    slots: {
+      thumb: 'medium',
+      path: ['media.flashArt', '5426', 'gif'],
+    },
+  });
 });