diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/snapshot/generateAlbumBanner.js | 34 | ||||
-rw-r--r-- | test/snapshot/generatePageBanner.js | 22 |
2 files changed, 56 insertions, 0 deletions
diff --git a/test/snapshot/generateAlbumBanner.js b/test/snapshot/generateAlbumBanner.js new file mode 100644 index 00000000..e2260cdd --- /dev/null +++ b/test/snapshot/generateAlbumBanner.js @@ -0,0 +1,34 @@ +import t from 'tap'; +import {testContentFunctions} from '../lib/content-function.js'; + +testContentFunctions(t, 'generateAlbumBanner (snapshot)', async (t, evaluate) => { + await evaluate.load(); + + evaluate.snapshot('basic behavior', { + name: 'generateAlbumBanner', + args: [{ + directory: 'cool-album', + hasBannerArt: true, + bannerDimensions: [800, 200], + bannerFileExtension: 'png', + }], + }); + + evaluate.snapshot('no dimensions', { + name: 'generateAlbumBanner', + args: [{ + directory: 'cool-album', + hasBannerArt: true, + bannerDimensions: null, + bannerFileExtension: 'png', + }], + }); + + evaluate.snapshot('no banner', { + name: 'generateAlbumBanner', + args: [{ + directory: 'cool-album', + hasBannerArt: false, + }], + }); +}); diff --git a/test/snapshot/generatePageBanner.js b/test/snapshot/generatePageBanner.js new file mode 100644 index 00000000..9ede9fce --- /dev/null +++ b/test/snapshot/generatePageBanner.js @@ -0,0 +1,22 @@ +import t from 'tap'; +import {testContentFunctions} from '../lib/content-function.js'; + +testContentFunctions(t, 'generatePageBanner (snapshot)', async (t, evaluate) => { + await evaluate.load(); + + evaluate.snapshot('basic behavior', { + name: 'generatePageBanner', + slots: { + path: ['media.albumBanner', 'cool-album', 'png'], + alt: 'Very cool banner art.', + dimensions: [800, 200], + }, + }); + + evaluate.snapshot('no dimensions', { + name: 'generatePageBanner', + slots: { + path: ['media.albumBanner', 'cool-album', 'png'], + }, + }); +}); |