From 261bf3acbf0ca93d2df2c78f426abfe2d9e8980c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 13 Jun 2023 18:50:51 -0300 Subject: test: generateCoverArtwork (snapshot) --- test/snapshot/generateCoverArtwork.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/snapshot/generateCoverArtwork.js (limited to 'test/snapshot/generateCoverArtwork.js') diff --git a/test/snapshot/generateCoverArtwork.js b/test/snapshot/generateCoverArtwork.js new file mode 100644 index 00000000..7c56f04d --- /dev/null +++ b/test/snapshot/generateCoverArtwork.js @@ -0,0 +1,33 @@ +import t from 'tap'; +import {testContentFunctions} from '../lib/content-function.js'; + +testContentFunctions(t, 'generateCoverArtwork (snapshot)', async (t, evaluate) => { + await evaluate.load(); + + const extraDependencies = { + getSizeOfImageFile: () => 0, + }; + + const artTags = [ + {name: 'Damara', directory: 'damara', isContentWarning: false}, + {name: 'Cronus', directory: 'cronus', isContentWarning: false}, + {name: 'Bees', directory: 'bees', isContentWarning: false}, + {name: 'creepy crawlies', isContentWarning: true}, + ]; + + const path = ['media.albumCover', 'bee-forus-seatbelt-safebee', 'png']; + + evaluate.snapshot('display: primary', { + name: 'generateCoverArtwork', + args: [artTags], + slots: {path, displayMode: 'primary'}, + extraDependencies, + }); + + evaluate.snapshot('display: thumbnail', { + name: 'generateCoverArtwork', + args: [artTags], + slots: {path, displayMode: 'thumbnail'}, + extraDependencies, + }); +}); -- cgit 1.3.0-6-gf8a5