From ddaf34d6e97269719107398569716fc1f1e98073 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 5 Sep 2023 19:03:44 -0300 Subject: infra, test: cleaner output for stubTemplate --- .../test/snapshot/generatePreviousNextLinks.js.test.cjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tap-snapshots/test/snapshot') diff --git a/tap-snapshots/test/snapshot/generatePreviousNextLinks.js.test.cjs b/tap-snapshots/test/snapshot/generatePreviousNextLinks.js.test.cjs index 07268581..fa641830 100644 --- a/tap-snapshots/test/snapshot/generatePreviousNextLinks.js.test.cjs +++ b/tap-snapshots/test/snapshot/generatePreviousNextLinks.js.test.cjs @@ -6,13 +6,13 @@ */ 'use strict' exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLinks (snapshot) > basic behavior 1`] = ` -previous: {"tooltip":true,"color":false,"attributes":{"id":"previous-button"},"content":"Previous"} -next: {"tooltip":true,"color":false,"attributes":{"id":"next-button"},"content":"Next"} +previous: { tooltip: true, color: false, attributes: { id: 'previous-button' }, content: 'Previous' } +next: { tooltip: true, color: false, attributes: { id: 'next-button' }, content: 'Next' } ` exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLinks (snapshot) > disable id 1`] = ` -previous: {"tooltip":true,"color":false,"attributes":{"id":false},"content":"Previous"} -next: {"tooltip":true,"color":false,"attributes":{"id":false},"content":"Next"} +previous: { tooltip: true, color: false, attributes: { id: false }, content: 'Previous' } +next: { tooltip: true, color: false, attributes: { id: false }, content: 'Next' } ` exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLinks (snapshot) > neither link present 1`] = ` @@ -20,9 +20,9 @@ exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLink ` exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLinks (snapshot) > next missing 1`] = ` -previous: {"tooltip":true,"color":false,"attributes":{"id":"previous-button"},"content":"Previous"} +previous: { tooltip: true, color: false, attributes: { id: 'previous-button' }, content: 'Previous' } ` exports[`test/snapshot/generatePreviousNextLinks.js TAP generatePreviousNextLinks (snapshot) > previous missing 1`] = ` -next: {"tooltip":true,"color":false,"attributes":{"id":"next-button"},"content":"Next"} +next: { tooltip: true, color: false, attributes: { id: 'next-button' }, content: 'Next' } ` -- cgit 1.3.0-6-gf8a5 From de0b85d81e6392597a35196bde523b9642d7e016 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 5 Sep 2023 20:09:03 -0300 Subject: test: update snapshot tests to always mock image dependency --- .../snapshot/generateAlbumCoverArtwork.js.test.cjs | 37 ++++++++++-------- .../test/snapshot/generateCoverArtwork.js.test.cjs | 37 ++++++++++-------- .../snapshot/generateTrackCoverArtwork.js.test.cjs | 45 +++++++++++++--------- .../test/snapshot/transformContent.js.test.cjs | 6 +-- 4 files changed, 69 insertions(+), 56 deletions(-) (limited to 'tap-snapshots/test/snapshot') diff --git a/tap-snapshots/test/snapshot/generateAlbumCoverArtwork.js.test.cjs b/tap-snapshots/test/snapshot/generateAlbumCoverArtwork.js.test.cjs index d787df68..017ab0e4 100644 --- a/tap-snapshots/test/snapshot/generateAlbumCoverArtwork.js.test.cjs +++ b/tap-snapshots/test/snapshot/generateAlbumCoverArtwork.js.test.cjs @@ -7,26 +7,29 @@ 'use strict' exports[`test/snapshot/generateAlbumCoverArtwork.js TAP generateAlbumCoverArtwork (snapshot) > display: primary 1`] = `
- -
-
-
-
- - - cw: creepy crawlies -
- click to show -
-
-
-
-
-
+ [mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'medium', id: 'cover-art', reveal: true, link: true, square: true }]

Tags: Damara, Cronus, Bees

` exports[`test/snapshot/generateAlbumCoverArtwork.js TAP generateAlbumCoverArtwork (snapshot) > display: thumbnail 1`] = ` -
+[mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'small', reveal: false, link: false, square: true }] ` diff --git a/tap-snapshots/test/snapshot/generateCoverArtwork.js.test.cjs b/tap-snapshots/test/snapshot/generateCoverArtwork.js.test.cjs index 88be76ea..c1c880bc 100644 --- a/tap-snapshots/test/snapshot/generateCoverArtwork.js.test.cjs +++ b/tap-snapshots/test/snapshot/generateCoverArtwork.js.test.cjs @@ -7,26 +7,29 @@ 'use strict' exports[`test/snapshot/generateCoverArtwork.js TAP generateCoverArtwork (snapshot) > display: primary 1`] = `
- -
-
-
-
- - - cw: creepy crawlies -
- click to show -
-
-
-
-
-
+ [mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'medium', id: 'cover-art', reveal: true, link: true, square: true }]

Tags: Damara, Cronus, Bees

` exports[`test/snapshot/generateCoverArtwork.js TAP generateCoverArtwork (snapshot) > display: thumbnail 1`] = ` -
+[mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'small', reveal: false, link: false, square: true }] ` diff --git a/tap-snapshots/test/snapshot/generateTrackCoverArtwork.js.test.cjs b/tap-snapshots/test/snapshot/generateTrackCoverArtwork.js.test.cjs index 92216a89..33b5d155 100644 --- a/tap-snapshots/test/snapshot/generateTrackCoverArtwork.js.test.cjs +++ b/tap-snapshots/test/snapshot/generateTrackCoverArtwork.js.test.cjs @@ -7,37 +7,44 @@ 'use strict' exports[`test/snapshot/generateTrackCoverArtwork.js TAP generateTrackCoverArtwork (snapshot) > display: primary - no unique art 1`] = `
- -
-
-
-
- - - cw: creepy crawlies -
- click to show -
-
-
-
-
-
+ [mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'medium', id: 'cover-art', reveal: true, link: true, square: true }]

Tags: Damara, Cronus, Bees

` exports[`test/snapshot/generateTrackCoverArtwork.js TAP generateTrackCoverArtwork (snapshot) > display: primary - unique art 1`] = `
-
+ [mocked: image + args: [ [ { name: 'Bees', directory: 'bees', isContentWarning: false } ] ] + slots: { path: [ 'media.trackCover', 'bee-forus-seatbelt-safebee', 'beesmp3', 'jpg' ], thumb: 'medium', id: 'cover-art', reveal: true, link: true, square: true }]

Tags: Bees

` exports[`test/snapshot/generateTrackCoverArtwork.js TAP generateTrackCoverArtwork (snapshot) > display: thumbnail - no unique art 1`] = ` -
+[mocked: image + args: [ + [ + { name: 'Damara', directory: 'damara', isContentWarning: false }, + { name: 'Cronus', directory: 'cronus', isContentWarning: false }, + { name: 'Bees', directory: 'bees', isContentWarning: false }, + { name: 'creepy crawlies', isContentWarning: true } + ] + ] + slots: { path: [ 'media.albumCover', 'bee-forus-seatbelt-safebee', 'png' ], thumb: 'small', reveal: false, link: false, square: true }] ` exports[`test/snapshot/generateTrackCoverArtwork.js TAP generateTrackCoverArtwork (snapshot) > display: thumbnail - unique art 1`] = ` -
+[mocked: image + args: [ [ { name: 'Bees', directory: 'bees', isContentWarning: false } ] ] + slots: { path: [ 'media.trackCover', 'bee-forus-seatbelt-safebee', 'beesmp3', 'jpg' ], thumb: 'small', reveal: false, link: false, square: true }] ` diff --git a/tap-snapshots/test/snapshot/transformContent.js.test.cjs b/tap-snapshots/test/snapshot/transformContent.js.test.cjs index d144cf12..4af6b147 100644 --- a/tap-snapshots/test/snapshot/transformContent.js.test.cjs +++ b/tap-snapshots/test/snapshot/transformContent.js.test.cjs @@ -53,16 +53,16 @@ How it goes

` exports[`test/snapshot/transformContent.js TAP transformContent (snapshot) > non-inline image #1 1`] = ` -
+
[mocked: image - slots: { src: 'spark.png', link: true, thumb: 'large' }]
` exports[`test/snapshot/transformContent.js TAP transformContent (snapshot) > non-inline image #2 1`] = `

Rad.

-
+
[mocked: image - slots: { src: 'spark.png', link: true, thumb: 'large' }]
` exports[`test/snapshot/transformContent.js TAP transformContent (snapshot) > non-inline image #3 1`] = ` -
+
[mocked: image - slots: { src: 'spark.png', link: true, thumb: 'large' }]

Baller.

` -- cgit 1.3.0-6-gf8a5 From aea700dc531b5183ad20c6fcbf8643aef3f102df Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 5 Sep 2023 20:24:08 -0300 Subject: test: fix & update generateAlbumSecondaryNav snapshot test --- .../test/snapshot/generateAlbumSecondaryNav.js.test.cjs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tap-snapshots/test/snapshot') diff --git a/tap-snapshots/test/snapshot/generateAlbumSecondaryNav.js.test.cjs b/tap-snapshots/test/snapshot/generateAlbumSecondaryNav.js.test.cjs index f84827ae..032fdc05 100644 --- a/tap-snapshots/test/snapshot/generateAlbumSecondaryNav.js.test.cjs +++ b/tap-snapshots/test/snapshot/generateAlbumSecondaryNav.js.test.cjs @@ -7,27 +7,27 @@ 'use strict' exports[`test/snapshot/generateAlbumSecondaryNav.js TAP generateAlbumSecondaryNav (snapshot) > basic behavior, mode: album 1`] = ` ` exports[`test/snapshot/generateAlbumSecondaryNav.js TAP generateAlbumSecondaryNav (snapshot) > basic behavior, mode: track 1`] = ` ` exports[`test/snapshot/generateAlbumSecondaryNav.js TAP generateAlbumSecondaryNav (snapshot) > dateless album in mixed group 1`] = ` ` -- cgit 1.3.0-6-gf8a5