diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-24 10:02:01 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-24 10:02:01 -0300 |
commit | 9f632c68f6a587a8621e509913c26d7c04794624 (patch) | |
tree | 2879ed7782a75e8d540ca72058b3018aeac08660 | |
parent | 942b05a2beed7d28e93ae256de0f58be5b7e385a (diff) | |
parent | d31c0fd9fce845276ab131f2f0d40616e1f56b40 (diff) |
Merge branch 'staging' into track-data-cleanup
-rw-r--r-- | tap-snapshots/test/snapshot/image.js.test.cjs | 8 | ||||
-rw-r--r-- | tap-snapshots/test/snapshot/linkContribution.js.test.cjs | 10 | ||||
-rw-r--r-- | test/snapshot/image.js | 18 |
3 files changed, 31 insertions, 5 deletions
diff --git a/tap-snapshots/test/snapshot/image.js.test.cjs b/tap-snapshots/test/snapshot/image.js.test.cjs index d87ab714..3cd1a317 100644 --- a/tap-snapshots/test/snapshot/image.js.test.cjs +++ b/tap-snapshots/test/snapshot/image.js.test.cjs @@ -39,6 +39,14 @@ exports[`test/snapshot/image.js TAP image (snapshot) > link with file size 1`] = <a class="box image-link" href="media/album-art/pingas/cover.png"><div class="image-container"><div class="image-inner-area"><img src="media/album-art/pingas/cover.png"></div></div></a> ` +exports[`test/snapshot/image.js TAP image (snapshot) > missing image path 1`] = ` +<div class="image-container"><div class="image-inner-area"><div class="image-text-area">(This image file is missing)</div></div></div> +` + +exports[`test/snapshot/image.js TAP image (snapshot) > missing image path w/ missingSourceContent 1`] = ` +<div class="image-container"><div class="image-inner-area"><div class="image-text-area">Cover's missing, whoops</div></div></div> +` + exports[`test/snapshot/image.js TAP image (snapshot) > source missing 1`] = ` <div class="image-container placeholder-image"><div class="image-inner-area"><div class="image-text-area">Example of missing source message.</div></div></div> ` diff --git a/tap-snapshots/test/snapshot/linkContribution.js.test.cjs b/tap-snapshots/test/snapshot/linkContribution.js.test.cjs index 7124ad18..b845a336 100644 --- a/tap-snapshots/test/snapshot/linkContribution.js.test.cjs +++ b/tap-snapshots/test/snapshot/linkContribution.js.test.cjs @@ -31,7 +31,7 @@ exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > loa exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > no accents 1`] = ` <a href="artist/clark-powell/">Clark Powell</a> -<a href="artist/the-big-baddies/">Grounder & Scratch</a> +<a href="artist/the-big-baddies/">Grounder & Scratch</a> <a href="artist/toby-fox/">Toby Fox</a> ` @@ -42,7 +42,7 @@ exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > no <use href="static/icons.svg#icon-soundcloud"></use> </svg> </a></span>) -<a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping) +<a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping) <a href="artist/toby-fox/">Toby Fox</a> (Arrangement) (<span class="icons"><a href="https://tobyfox.bandcamp.com/" class="icon"> <svg> <title>Bandcamp</title> @@ -58,7 +58,7 @@ exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > no exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > only showContribution 1`] = ` <a href="artist/clark-powell/">Clark Powell</a> -<span class="nowrap"><a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping)</span> +<span class="nowrap"><a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping)</span> <span class="nowrap"><a href="artist/toby-fox/">Toby Fox</a> (Arrangement)</span> ` @@ -69,7 +69,7 @@ exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > onl <use href="static/icons.svg#icon-soundcloud"></use> </svg> </a></span>)</span> -<a href="artist/the-big-baddies/">Grounder & Scratch</a> +<a href="artist/the-big-baddies/">Grounder & Scratch</a> <span class="nowrap"><a href="artist/toby-fox/">Toby Fox</a> (<span class="icons"><a href="https://tobyfox.bandcamp.com/" class="icon"> <svg> <title>Bandcamp</title> @@ -90,7 +90,7 @@ exports[`test/snapshot/linkContribution.js TAP linkContribution (snapshot) > sho <use href="static/icons.svg#icon-soundcloud"></use> </svg> </a></span>)</span> -<span class="nowrap"><a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping)</span> +<span class="nowrap"><a href="artist/the-big-baddies/">Grounder & Scratch</a> (Snooping)</span> <span class="nowrap"><a href="artist/toby-fox/">Toby Fox</a> (Arrangement) (<span class="icons"><a href="https://tobyfox.bandcamp.com/" class="icon"> <svg> <title>Bandcamp</title> diff --git a/test/snapshot/image.js b/test/snapshot/image.js index 8608ab69..2a1e9805 100644 --- a/test/snapshot/image.js +++ b/test/snapshot/image.js @@ -14,6 +14,7 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => { getThumbnailEqualOrSmaller: () => 'medium', getThumbnailsAvailableForDimensions: () => [['large', 800], ['medium', 400], ['small', 250]], + missingImagePaths: ['album-art/missing/cover.png'], ...extraDependencies, }, ...opts, @@ -114,6 +115,7 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => { getThumbnailsAvailableForDimensions: () => [['voluminous', 1200], ['middling', 900], ['petite', 20]], getThumbnailEqualOrSmaller: () => 'voluminous', + missingImagePaths: [], }, slots: { thumb: 'gargantuan', @@ -127,4 +129,20 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => { path: ['media.flashArt', '5426', 'gif'], }, }); + + quickSnapshot('missing image path', { + slots: { + thumb: 'medium', + path: ['media.albumCover', 'missing', 'png'], + link: true, + }, + }); + + quickSnapshot('missing image path w/ missingSourceContent', { + slots: { + thumb: 'medium', + path: ['media.albumCover', 'missing', 'png'], + missingSourceContent: `Cover's missing, whoops`, + }, + }); }); |