From d194fc4f537ee79b0558b54ff2e1fdc3e9cbf4d9 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 4 Sep 2023 20:48:54 -0300 Subject: test: update & fix-up image snapshot tests --- test/snapshot/image.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') 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'], + }, + }); }); -- cgit 1.3.0-6-gf8a5