diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-10-15 14:27:29 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-10-15 14:27:29 -0300 |
commit | 1aa217195f4d5f82653e29d6c265f92c2d1bbd7e (patch) | |
tree | 98511aa6b51bdc5cbc4c31ddcf144f03bf2b8422 /test | |
parent | 643797e6a2dcf4c39117e6ef99d9c8672e2d2511 (diff) |
test: remove all existing snapshot tests
Deliberately keeping evaluate.snapshot() for possible future use. There are also these folders which were seemingly never included in the working tree: test/snapshot/complete test/snapshot/isolated test/snapshot/mixed If and when we come back to snasphot tests, maybe we'll bounce off of that idea shaped out of three words.
Diffstat (limited to 'test')
-rw-r--r-- | test/snapshot/generateAlbumBanner.js | 34 | ||||
-rw-r--r-- | test/snapshot/generateAlbumReleaseInfo.js | 74 | ||||
-rw-r--r-- | test/snapshot/generateAlbumSecondaryNav.js | 90 | ||||
-rw-r--r-- | test/snapshot/generateAlbumSidebarGroupBox.js | 57 | ||||
-rw-r--r-- | test/snapshot/generateAlbumTrackList.js | 123 | ||||
-rw-r--r-- | test/snapshot/generateBanner.js | 22 | ||||
-rw-r--r-- | test/snapshot/generateTrackReleaseInfo.js | 51 | ||||
-rw-r--r-- | test/snapshot/image.js | 132 | ||||
-rw-r--r-- | test/snapshot/linkArtist.js | 30 | ||||
-rw-r--r-- | test/snapshot/linkContribution.js | 73 | ||||
-rw-r--r-- | test/snapshot/linkExternal.js | 225 | ||||
-rw-r--r-- | test/snapshot/linkTemplate.js | 63 | ||||
-rw-r--r-- | test/snapshot/linkThing.js | 94 | ||||
-rw-r--r-- | test/snapshot/transformContent.js | 171 |
14 files changed, 0 insertions, 1239 deletions
diff --git a/test/snapshot/generateAlbumBanner.js b/test/snapshot/generateAlbumBanner.js deleted file mode 100644 index 8e63308f..00000000 --- a/test/snapshot/generateAlbumBanner.js +++ /dev/null @@ -1,34 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -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/generateAlbumReleaseInfo.js b/test/snapshot/generateAlbumReleaseInfo.js deleted file mode 100644 index f41e502d..00000000 --- a/test/snapshot/generateAlbumReleaseInfo.js +++ /dev/null @@ -1,74 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateAlbumReleaseInfo (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - evaluate.snapshot('basic behavior', { - name: 'generateAlbumReleaseInfo', - args: [{ - artistContribs: [ - {artist: {name: 'Toby Fox', directory: 'toby-fox', urls: []}, annotation: 'music probably'}, - {artist: {name: 'Tensei', directory: 'tensei', urls: ['https://tenseimusic.bandcamp.com/']}, annotation: 'hot jams'}, - ], - - coverArtistContribs: [ - {artist: {name: 'Hanni Brosh', directory: 'hb', urls: []}, annotation: null}, - ], - - wallpaperArtistContribs: [ - {artist: {name: 'Hanni Brosh', directory: 'hb', urls: []}, annotation: null}, - {artist: {name: 'Niklink', directory: 'niklink', urls: []}, annotation: 'edits'}, - ], - - bannerArtistContribs: [ - {artist: {name: 'Hanni Brosh', directory: 'hb', urls: []}, annotation: null}, - {artist: {name: 'Niklink', directory: 'niklink', urls: []}, annotation: 'edits'}, - ], - - name: 'AlterniaBound', - date: new Date('March 14, 2011'), - coverArtDate: new Date('April 1, 1991'), - urls: [ - 'https://homestuck.bandcamp.com/album/alterniabound-with-alternia', - 'https://www.youtube.com/playlist?list=PLnVpmehyaOFZWO9QOZmD6A3TIK0wZ6xE2', - 'https://www.youtube.com/watch?v=HO5V2uogkYc', - ], - - tracks: [{duration: 253}, {duration: 372}], - }], - }); - - const sparse = { - artistContribs: [], - coverArtistContribs: [], - wallpaperArtistContribs: [], - bannerArtistContribs: [], - - name: 'Suspicious Album', - urls: [], - tracks: [], - }; - - evaluate.snapshot('reduced details', { - name: 'generateAlbumReleaseInfo', - args: [sparse], - }); - - evaluate.snapshot('URLs only', { - name: 'generateAlbumReleaseInfo', - args: [{ - ...sparse, - urls: ['https://homestuck.bandcamp.com/foo', 'https://soundcloud.com/bar'], - }], - }); - - evaluate.snapshot('equal cover art date', { - name: 'generateAlbumReleaseInfo', - args: [{ - ...sparse, - date: new Date('2020-04-13'), - coverArtDate: new Date('2020-04-13'), - }], - }); -}); diff --git a/test/snapshot/generateAlbumSecondaryNav.js b/test/snapshot/generateAlbumSecondaryNav.js deleted file mode 100644 index 2495bc4a..00000000 --- a/test/snapshot/generateAlbumSecondaryNav.js +++ /dev/null @@ -1,90 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateAlbumSecondaryNav (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - let album, anotherAlbum, group1, group2; - - group1 = { - name: 'VCG', - directory: 'vcg', - color: '#abcdef', - serieses: [], - }; - - group2 = { - name: 'Bepis', - directory: 'bepis', - color: '#123456', - serieses: [], - }; - - album = { - name: 'Album', - directory: 'album', - date: new Date('2010-04-13'), - groups: [group1, group2], - }; - - anotherAlbum = { - name: 'Last', - directory: 'last', - date: new Date('2010-06-12'), - }; - - group1.albums = [ - { - name: 'First', - directory: 'first', - date: new Date('2010-04-10'), - }, - album, - anotherAlbum, - ]; - - group1.serieses = [ - { - name: 'Series', - albums: [album, anotherAlbum], - group: group1, - }, - ]; - - group2.albums = [ - album, - { - name: 'Second', - directory: 'second', - date: new Date('2011-04-13'), - }, - ]; - - evaluate.snapshot('basic behavior, mode: album', { - name: 'generateAlbumSecondaryNav', - args: [album], - slots: {mode: 'album'}, - }); - - evaluate.snapshot('basic behavior, mode: track', { - name: 'generateAlbumSecondaryNav', - args: [album], - slots: {mode: 'track'}, - }); - - album = { - date: null, - groups: [group1, group2], - }; - - group1.albums = [ - ...group1.albums, - album, - ]; - - evaluate.snapshot('dateless album in mixed group', { - name: 'generateAlbumSecondaryNav', - args: [album], - slots: {mode: 'album'}, - }); -}); diff --git a/test/snapshot/generateAlbumSidebarGroupBox.js b/test/snapshot/generateAlbumSidebarGroupBox.js deleted file mode 100644 index f920bd96..00000000 --- a/test/snapshot/generateAlbumSidebarGroupBox.js +++ /dev/null @@ -1,57 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateAlbumSidebarGroupBox (snapshot)', async (t, evaluate) => { - await evaluate.load({ - mock: { - ...evaluate.mock.transformContent, - }, - }); - - let album, group; - - album = { - name: 'Middle', - directory: 'middle', - date: new Date('2010-04-13'), - }; - - group = { - name: 'VCG', - directory: 'vcg', - descriptionShort: 'Very cool group.', - urls: ['https://vcg.bandcamp.com/', 'https://youtube.com/@vcg'], - albums: [ - {name: 'First', directory: 'first', date: new Date('2010-04-10')}, - album, - {name: 'Last', directory: 'last', date: new Date('2010-06-12')}, - ], - }; - - evaluate.snapshot('basic behavior, mode: album', { - name: 'generateAlbumSidebarGroupBox', - args: [album, group], - slots: {mode: 'album'}, - }); - - evaluate.snapshot('basic behavior, mode: track', { - name: 'generateAlbumSidebarGroupBox', - args: [album, group], - slots: {mode: 'track'}, - }); - - album = { - date: null, - }; - - group.albums = [ - ...group.albums, - album, - ]; - - evaluate.snapshot('dateless album in mixed group', { - name: 'generateAlbumSidebarGroupBox', - args: [album, group], - slots: {mode: 'album'}, - }); -}); diff --git a/test/snapshot/generateAlbumTrackList.js b/test/snapshot/generateAlbumTrackList.js deleted file mode 100644 index e09f1c4a..00000000 --- a/test/snapshot/generateAlbumTrackList.js +++ /dev/null @@ -1,123 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) => { - await evaluate.load({ - mock: { - generateAlbumTrackListMissingDuration: - evaluate.stubContentFunction('generateAlbumTrackListMissingDuration'), - - image: - evaluate.stubContentFunction('image'), - }, - }); - - const contribs1 = [ - {artist: {name: 'Apricot', directory: 'apricot', urls: []}}, - ]; - - const contribs2 = [ - {artist: {name: 'Apricot', directory: 'apricot', urls: []}}, - {artist: {name: 'Peach', directory: 'peach', urls: ['https://peach.bandcamp.com/']}}, - {artist: {name: 'Cerise', directory: 'cerise', urls: []}}, - ]; - - const color1 = '#fb07ff'; - const color2 = '#ea2e83'; - - const tracks = [ - {name: 'Track 1', directory: 't1', duration: 20, artistContribs: contribs1, color: color1}, - {name: 'Track 2', directory: 't2', duration: 0, artistContribs: contribs1, color: color1}, - {name: 'Track 3', directory: 't3', duration: 40, artistContribs: contribs1, color: color1}, - {name: 'Track 4', directory: 't4', duration: 0, artistContribs: contribs2, color: color2}, - ]; - - const albumWithTrackSections = { - color: color1, - artistContribs: contribs1, - trackSections: [ - {name: 'First section', tracks: tracks.slice(0, 3)}, - {name: 'Second section', tracks: tracks.slice(3)}, - ], - tracks, - }; - - const albumWithoutTrackSections = { - color: color1, - artistContribs: contribs1, - trackSections: [{isDefaultTrackSection: true, tracks}], - tracks, - }; - - const albumWithTrackSectionDescriptions = { - color: color1, - artistContribs: contribs1, - trackSections: [ - {name: 'First section', tracks: tracks.slice(0, 3), description: `Why yes!`}, - {name: 'Second section', tracks: tracks.slice(3), description: `How *contentful,* this is.`}, - ], - tracks, - }; - - const albumWithNoDuration = { - color: color1, - artistContribs: contribs1, - trackSections: [{isDefaultTrackSection: true, tracks: [tracks[1], tracks[3]]}], - tracks: [tracks[1], tracks[3]], - }; - - evaluate.snapshot(`basic behavior, with track sections`, { - name: 'generateAlbumTrackList', - args: [albumWithTrackSections], - }); - - evaluate.snapshot(`basic behavior, default track section`, { - name: 'generateAlbumTrackList', - args: [albumWithoutTrackSections], - }); - - evaluate.snapshot(`basic behavior, with descriptions`, { - name: 'generateAlbumTrackList', - args: [albumWithTrackSectionDescriptions], - }); - - evaluate.snapshot(`collapseDurationScope: never`, { - name: 'generateAlbumTrackList', - slots: {collapseDurationScope: 'never'}, - multiple: [ - {args: [albumWithTrackSections]}, - {args: [albumWithoutTrackSections]}, - {args: [albumWithNoDuration]}, - ], - }); - - evaluate.snapshot(`collapseDurationScope: track`, { - name: 'generateAlbumTrackList', - slots: {collapseDurationScope: 'track'}, - multiple: [ - {args: [albumWithTrackSections]}, - {args: [albumWithoutTrackSections]}, - {args: [albumWithNoDuration]}, - ], - }); - - evaluate.snapshot(`collapseDurationScope: section`, { - name: 'generateAlbumTrackList', - slots: {collapseDurationScope: 'section'}, - multiple: [ - {args: [albumWithTrackSections]}, - {args: [albumWithoutTrackSections]}, - {args: [albumWithNoDuration]}, - ], - }); - - evaluate.snapshot(`collapseDurationScope: album`, { - name: 'generateAlbumTrackList', - slots: {collapseDurationScope: 'album'}, - multiple: [ - {args: [albumWithTrackSections]}, - {args: [albumWithoutTrackSections]}, - {args: [albumWithNoDuration]}, - ], - }); -}); diff --git a/test/snapshot/generateBanner.js b/test/snapshot/generateBanner.js deleted file mode 100644 index ab57c3cc..00000000 --- a/test/snapshot/generateBanner.js +++ /dev/null @@ -1,22 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateBanner (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - evaluate.snapshot('basic behavior', { - name: 'generateBanner', - slots: { - path: ['media.albumBanner', 'cool-album', 'png'], - alt: 'Very cool banner art.', - dimensions: [800, 200], - }, - }); - - evaluate.snapshot('no dimensions', { - name: 'generateBanner', - slots: { - path: ['media.albumBanner', 'cool-album', 'png'], - }, - }); -}); diff --git a/test/snapshot/generateTrackReleaseInfo.js b/test/snapshot/generateTrackReleaseInfo.js deleted file mode 100644 index 931377c8..00000000 --- a/test/snapshot/generateTrackReleaseInfo.js +++ /dev/null @@ -1,51 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'generateTrackReleaseInfo (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - const artistContribs = [{artist: {name: 'Toby Fox', directory: 'toby-fox', urls: []}, annotation: null}]; - const coverArtistContribs = [{artist: {name: 'Alpaca', directory: 'alpaca', urls: []}, annotation: '🔥'}]; - - evaluate.snapshot('basic behavior', { - name: 'generateTrackReleaseInfo', - args: [{ - artistContribs, - name: 'An Apple Disaster!!', - date: new Date('2011-11-30'), - duration: 58, - urls: ['https://soundcloud.com/foo', 'https://youtube.com/watch?v=bar'], - }], - }); - - const sparse = { - artistContribs, - name: 'Suspicious Track', - date: null, - duration: null, - urls: [], - }; - - evaluate.snapshot('reduced details', { - name: 'generateTrackReleaseInfo', - args: [sparse], - }); - - evaluate.snapshot('cover artist contribs, non-unique', { - name: 'generateTrackReleaseInfo', - args: [{ - ...sparse, - coverArtistContribs, - hasUniqueCoverArt: false, - }], - }); - - evaluate.snapshot('cover artist contribs, unique', { - name: 'generateTrackReleaseInfo', - args: [{ - ...sparse, - coverArtistContribs, - hasUniqueCoverArt: true, - }], - }); -}); diff --git a/test/snapshot/image.js b/test/snapshot/image.js deleted file mode 100644 index 1985211f..00000000 --- a/test/snapshot/image.js +++ /dev/null @@ -1,132 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - 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]], - missingImagePaths: ['album-art/missing/cover.png'], - ...extraDependencies, - }, - ...opts, - }); - - quickSnapshot('source via path', { - slots: { - path: ['media.albumCover', 'beyond-canon', 'png'], - }, - }); - - quickSnapshot('source via src', { - slots: { - src: 'https://example.com/bananas.gif', - }, - }); - - quickSnapshot('source missing', { - slots: { - missingSourceContent: 'Example of missing source message.', - }, - }); - - quickSnapshot('dimensions', { - slots: { - src: 'foobar', - dimensions: [600, 400], - }, - }); - - quickSnapshot('square', { - slots: { - src: 'foobar', - square: true, - }, - }); - - quickSnapshot('dimensions with square', { - slots: { - src: 'foobar', - dimensions: [600, 400], - square: true, - }, - }); - - quickSnapshot('lazy with square', { - slots: { - src: 'foobar', - lazy: true, - square: true, - }, - }); - - quickSnapshot('link with file size', { - extraDependencies: { - getSizeOfImagePath: () => 10 ** 6, - }, - slots: { - path: ['media.albumCover', 'pingas', 'png'], - link: true, - }, - }); - - quickSnapshot('content warnings via tags', { - args: [ - [ - {name: 'Dirk Strider', directory: 'dirk'}, - {name: 'too cool for school', isContentWarning: true}, - ], - ], - slots: { - path: ['media.albumCover', 'beyond-canon', 'png'], - }, - }); - - evaluate.snapshot('thumbnail details', { - name: 'image', - extraDependencies: { - checkIfImagePathHasCachedThumbnails: () => true, - getSizeOfImagePath: () => 0, - getDimensionsOfImagePath: () => [900, 1200], - getThumbnailsAvailableForDimensions: () => - [['voluminous', 1200], ['middling', 900], ['petite', 20]], - getThumbnailEqualOrSmaller: () => 'voluminous', - missingImagePaths: [], - }, - slots: { - thumb: 'gargantuan', - path: ['media.albumCover', 'beyond-canon', 'png'], - }, - }); - - quickSnapshot('thumb requested but source is gif', { - slots: { - thumb: 'medium', - 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`, - }, - }); -}); diff --git a/test/snapshot/linkArtist.js b/test/snapshot/linkArtist.js deleted file mode 100644 index 7b2114b5..00000000 --- a/test/snapshot/linkArtist.js +++ /dev/null @@ -1,30 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'linkArtist (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - evaluate.snapshot('basic behavior', { - name: 'linkArtist', - args: [ - { - name: `Toby Fox`, - directory: `toby-fox`, - } - ], - }); - - evaluate.snapshot('prefer short name', { - name: 'linkArtist', - args: [ - { - name: 'ICCTTCMDMIROTMCWMWFTPFTDDOTARHPOESWGBTWEATFCWSEBTSSFOFG', - nameShort: '55gore', - directory: '55gore', - }, - ], - slots: { - preferShortName: true, - }, - }); -}); diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js deleted file mode 100644 index 47ef1503..00000000 --- a/test/snapshot/linkContribution.js +++ /dev/null @@ -1,73 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - const quickSnapshot = (message, slots) => - evaluate.snapshot(message, { - name: 'linkContribution', - multiple: [ - {args: [ - {artist: { - name: 'Clark Powell', - directory: 'clark-powell', - urls: ['https://soundcloud.com/plazmataz'], - }, annotation: null}, - ]}, - {args: [ - {artist: { - name: 'Grounder & Scratch', - directory: 'the-big-baddies', - urls: [], - }, annotation: 'Snooping'}, - ]}, - {args: [ - {artist: { - name: 'Toby Fox', - directory: 'toby-fox', - urls: ['https://tobyfox.bandcamp.com/', 'https://toby.fox/'], - }, annotation: 'Arrangement'}, - ]}, - ], - slots, - }); - - quickSnapshot('showAnnotation & showExternalLinks', { - showAnnotation: true, - showExternalLinks: true, - }); - - quickSnapshot('only showAnnotation', { - showAnnotation: true, - }); - - quickSnapshot('only showExternalLinks', { - showExternalLinks: true, - }); - - quickSnapshot('no accents', {}); - - evaluate.snapshot('loads of links', { - name: 'linkContribution', - args: [ - {artist: {name: 'Lorem Ipsum Lover', directory: 'lorem-ipsum-lover', urls: [ - 'https://loremipsum.io', - 'https://loremipsum.io/generator/', - 'https://loremipsum.io/#meaning', - 'https://loremipsum.io/#usage-and-examples', - 'https://loremipsum.io/#controversy', - 'https://loremipsum.io/#when-to-use-lorem-ipsum', - 'https://loremipsum.io/#lorem-ipsum-all-the-things', - 'https://loremipsum.io/#original-source', - ]}, annotation: null}, - ], - slots: {showExternalLinks: true}, - }); - - quickSnapshot('no preventWrapping', { - showAnnotation: true, - showExternalLinks: true, - preventWrapping: false, - }); -}); diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js deleted file mode 100644 index 90c98f4b..00000000 --- a/test/snapshot/linkExternal.js +++ /dev/null @@ -1,225 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - evaluate.snapshot('unknown domain (arbitrary world wide web path)', { - name: 'linkExternal', - args: ['https://snoo.ping.as/usual/i/see/'], - }); - - const urlsToArgs = urls => - urls.map(url => ({args: [url]})); - - const quickSnapshot = (message, urls, slots) => - evaluate.snapshot(message, { - name: 'linkExternal', - slots, - multiple: urlsToArgs(urls), - }); - - const quickSnapshotAllStyles = (context, urls) => { - for (const style of ['platform', 'handle']) { - const message = `context: ${context}, style: ${style}`; - quickSnapshot(message, urls, {context, style}); - } - }; - - // Try to comprehensively test every regular expression - // (in `match` and extractions like `handle` or `details`). - - // Try to *also* represent a reasonable variety of what kinds - // of URLs appear throughout the wiki. (This should serve to - // identify areas which #external-links is expected to - // accommodate, regardless whether or not there is special - // attention given in the actual descriptors.) - - // For normal custom-domain matches (e.g. Mastodon), - // it's OK to just test one custom domain in the list. - - // Generally match the sorting order in externalLinkSpec, - // so corresponding and missing test cases are easy to locate. - - quickSnapshotAllStyles('generic', [ - // platform: appleMusic - 'https://music.apple.com/us/artist/system-of-a-down/462715', - - // platform: artstation - 'https://www.artstation.com/eevaningtea', - 'https://witnesstheabsurd.artstation.com/', - - // platform: bandcamp - 'https://music.solatrus.com/', - 'https://homestuck.bandcamp.com/', - - // platform: bluesky - 'https://bsky.app/profile/jacobtheloofah.bsky.social', - - // platform: carrd - 'https://aliceflare.carrd.co', - 'https://bigchaslappa.carrd.co/', - - // platform: cohost - 'https://cohost.org/cosmoptera', - - // platform: deconreconstruction.music - 'https://music.deconreconstruction.com/albums/catch-322', - 'https://music.deconreconstruction.com/albums/catch-322?track=arcjecs-theme', - - // platform: deconreconstruction - 'https://www.deconreconstruction.com/', - - // platform: deviantart - 'https://culdhira.deviantart.com', - 'https://www.deviantart.com/chesswanderlust-sama', - 'https://www.deviantart.com/shilloshilloh/art/Homestuck-Jake-English-268874606', - - // platform: facebook - 'https://www.facebook.com/DoomedCloud/', - 'https://www.facebook.com/pages/WoodenToaster/280642235307371', - 'https://www.facebook.com/Svixy/posts/400018786702633', - - // platform: fandom.mspaintadventures - 'https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary', - 'https://mspaintadventures.fandom.com/wiki/', - 'https://mspaintadventures.fandom.com/', - - // platform: fandom - 'https://community.fandom.com/', - 'https://community.fandom.com/wiki/', - 'https://community.fandom.com/wiki/Community_Central', - - // platform: gamebanana - 'https://gamebanana.com/members/2028092', - 'https://gamebanana.com/mods/459476', - - // platform: homestuck - 'https://homestuck.com/', - - // platform: hsmusic.archive - 'https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3', - - // platform: hsmusic - 'https://hsmusic.wiki/feedback/', - - // platform: internetArchive - 'https://archive.org/details/a-life-well-lived', - 'https://archive.org/details/VastError_Volume1/11+Renaissance.mp3', - - // platform: instagram - 'https://instagram.com/bass.and.noises', - 'https://www.instagram.com/levc_egm/', - - // platform: itch - 'https://tuyoki.itch.io/', - 'https://itch.io/profile/bravelittletoreador', - - // platform: ko-fi - 'https://ko-fi.com/gnaach', - - // platform: linktree - 'https://linktr.ee/bbpanzu', - - // platform: mastodon - 'https://types.pl/', - - // platform: mspfa - 'https://canwc.mspfa.com/', - 'https://mspfa.com/?s=12003&p=1045', - 'https://mspfa.com/user/?u=103334508819793669241', - - // platform: neocities - 'https://wodaro.neocities.org', - 'https://neomints.neocities.org/', - - // platform: newgrounds - 'https://buzinkai.newgrounds.com/', - 'https://www.newgrounds.com/audio/listen/1256058', - - // platform: patreon - 'https://www.patreon.com/CecilyRenns', - - // platform: poetryFoundation - 'https://www.poetryfoundation.org/poets/christina-rossetti', - 'https://www.poetryfoundation.org/poems/45000/remember-56d224509b7ae', - - // platform: soundcloud - 'https://soundcloud.com/plazmataz', - 'https://soundcloud.com/worthikids/1-i-accidentally-broke-my', - - // platform: spotify - 'https://open.spotify.com/artist/63SNNpNOicDzG3LY82G4q3', - 'https://open.spotify.com/album/0iHvPD8rM3hQa0qeVtPQ3t', - 'https://open.spotify.com/track/6YEGQH32aAXb9vQQbBrPlw', - - // platform: tiktok - 'https://www.tiktok.com/@richaadeb', - - // platform: toyhouse - 'https://toyhou.se/ghastaboo', - - // platform: tumblr - 'https://aeritus.tumblr.com/', - 'https://vol5anthology.tumblr.com/post/159528808107/hey-everyone-its-413-and-that-means-we-have', - 'https://www.tumblr.com/electricwestern', - 'https://www.tumblr.com/spellmynamewithabang/142767566733/happy-413-this-is-the-first-time-anyones-heard', - - // platform: twitch - 'https://www.twitch.tv/ajhebard', - 'https://www.twitch.tv/vargskelethor/', - - // platform: twitter - 'https://twitter.com/awkwarddoesart', - 'https://twitter.com/purenonsens/', - 'https://twitter.com/circlejourney/status/1202265927183548416', - - // platform: waybackMachine - 'https://web.archive.org/web/20120405160556/https://homestuck.bandcamp.com/album/colours-and-mayhem-universe-a', - 'https://web.archive.org/web/20160807111207/http://griffinspacejam.com:80/', - - // platform: wikipedia - 'https://en.wikipedia.org/wiki/Haydn_Quartet_(vocal_ensemble)', - - // platform: youtube - 'https://youtube.com/@bani-chan8949', - 'https://www.youtube.com/@Razzie16', - 'https://www.youtube.com/channel/UCQXfvlKkpbOqEz4BepHqK7g', - 'https://www.youtube.com/watch?v=6ekVnZm29kw', - 'https://youtu.be/WBkC038wSio', - 'https://www.youtube.com/playlist?list=PLy5UGIMKOXpONMExgI7lVYFwQa54QFp_H', - ]); - - quickSnapshotAllStyles('album', [ - 'https://youtu.be/abc', - 'https://youtube.com/watch?v=abc', - 'https://youtube.com/Playlist?list=kweh', - ]); - - quickSnapshotAllStyles('albumNoTracks', [ - 'https://youtu.be/abc', - 'https://youtube.com/watch?v=abc', - 'https://youtube.com/Playlist?list=kweh', - ]); - - quickSnapshotAllStyles('albumOneTrack', [ - 'https://youtu.be/abc', - 'https://youtube.com/watch?v=abc', - 'https://youtube.com/Playlist?list=kweh', - ]); - - quickSnapshotAllStyles('albumMultipleTracks', [ - 'https://youtu.be/abc', - 'https://youtube.com/watch?v=abc', - 'https://youtube.com/Playlist?list=kweh', - ]); - - quickSnapshotAllStyles('flash', [ - 'https://www.bgreco.net/hsflash/002238.html', - 'https://homestuck.com/story/1234', - 'https://homestuck.com/story/pony', - 'https://www.youtube.com/watch?v=wKgOp3Kg2wI', - 'https://youtu.be/IOcvkkklWmY', - 'https://some.external.site/foo/bar/', - ]); -}); diff --git a/test/snapshot/linkTemplate.js b/test/snapshot/linkTemplate.js deleted file mode 100644 index 300065e2..00000000 --- a/test/snapshot/linkTemplate.js +++ /dev/null @@ -1,63 +0,0 @@ -import t from 'tap'; -import * as html from '#html'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'linkTemplate (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - evaluate.snapshot('fill many slots', { - name: 'linkTemplate', - - slots: { - 'href': 'https://hsmusic.wiki/media/cool file.pdf', - 'hash': 'fooey', - 'attributes': {class: 'dog', id: 'cat1'}, - 'content': 'My Cool Link', - }, - }); - - evaluate.snapshot('fill path slot & provide appendIndexHTML', { - name: 'linkTemplate', - - extraDependencies: { - to: (...path) => '/c*lzone/' + path.join('/') + '/', - appendIndexHTML: true, - }, - - slots: { - path: ['myCoolPath', 'ham', 'pineapple', 'tomato'], - content: 'delish', - }, - }); - - evaluate.snapshot('special characters in path argument', { - name: 'linkTemplate', - slots: { - path: [ - 'media.albumAdditionalFile', - 'homestuck-vol-1', - 'Showtime (Piano Refrain) - #xXxAwesomeSheetMusick?rxXx#.pdf', - ], - content: `Damn, that's some good sheet music`, - }, - }); - - evaluate.snapshot('missing content', { - name: 'linkTemplate', - slots: {href: 'banana'}, - }); - - evaluate.snapshot('link in content', { - name: 'linkTemplate', - slots: { - hash: 'the-more-ye-know', - content: [ - `Oh geez oh heck`, - html.tag('a', {href: 'dogs'}, `There's a link in here!!`), - `But here's <b>a normal tag.</b>`, - html.tag('div', `Gotta keep them normal tags.`), - html.tag('div', `But not... <a href="#">NESTED LINKS, OOO.</a>`), - ], - }, - }); -}); diff --git a/test/snapshot/linkThing.js b/test/snapshot/linkThing.js deleted file mode 100644 index 9b5cff33..00000000 --- a/test/snapshot/linkThing.js +++ /dev/null @@ -1,94 +0,0 @@ -import t from 'tap'; -import * as html from '#html'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'linkThing (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - const quickSnapshot = (message, oneOrMultiple) => - evaluate.snapshot(message, - (Array.isArray(oneOrMultiple) - ? {name: 'linkThing', multiple: oneOrMultiple} - : {name: 'linkThing', ...oneOrMultiple})); - - quickSnapshot('basic behavior', { - args: ['localized.track', { - directory: 'foo', - color: '#abcdef', - name: `Cool track!`, - }], - }); - - quickSnapshot('preferShortName', { - args: ['localized.artTagGallery', { - directory: 'five-oceanfalls', - name: 'Five (Oceanfalls)', - nameShort: 'Five', - }], - slots: {preferShortName: true}, - }); - - quickSnapshot('tooltip & content', { - args: ['localized.album', { - directory: 'beyond-canon', - name: 'Beyond Canon', - nameShort: 'BC', - }], - multiple: [ - {slots: {tooltipStyle: 'none'}}, - {slots: {tooltipStyle: 'browser'}}, - {slots: {tooltipStyle: 'browser', content: 'Next'}}, - {slots: {tooltipStyle: 'auto'}}, - {slots: {tooltipStyle: 'auto', preferShortName: true}}, - {slots: {tooltipStyle: 'auto', preferShortName: true, content: 'Next'}}, - {slots: {tooltipStyle: 'auto', content: 'Next'}}, - {slots: {tooltipStyle: 'wiki'}}, - {slots: {tooltipStyle: 'wiki', content: 'Next'}}, - {slots: {content: 'Banana'}}, - ], - }); - - quickSnapshot('color', { - args: ['localized.track', { - directory: 'showtime-piano-refrain', - name: 'Showtime (Piano Refrain)', - color: '#38f43d', - }], - multiple: [ - {slots: {color: false}}, - {slots: {color: true}}, - {slots: {color: '#aaccff'}}, - {slots: {color: '#aaccff', tooltipStyle: 'wiki'}}, - ], - }); - - quickSnapshot('tags in name escaped', [ - {args: ['localized.track', { - directory: 'foo', - name: `<a href="SNOOPING">AS USUAL</a> I SEE`, - }]}, - {args: ['localized.track', { - directory: 'bar', - name: `<b>boldface</b>`, - }]}, - {args: ['localized.album', { - directory: 'exile', - name: '>Exile<', - }]}, - {args: ['localized.track', { - directory: 'heart', - name: '<3', - }]}, - ]); - - quickSnapshot('nested links in content stripped', { - args: ['localized.staticPage', {directory: 'foo', name: 'Foo'}], - slots: { - content: - html.tag('b', {[html.joinChildren]: ''}, [ - html.tag('a', {href: 'bar'}, `Oooo!`), - ` Very spooky.`, - ]), - }, - }); -}); diff --git a/test/snapshot/transformContent.js b/test/snapshot/transformContent.js deleted file mode 100644 index 63391681..00000000 --- a/test/snapshot/transformContent.js +++ /dev/null @@ -1,171 +0,0 @@ -import t from 'tap'; -import {testContentFunctions} from '#test-lib'; - -testContentFunctions(t, 'transformContent (snapshot)', async (t, evaluate) => { - await evaluate.load({ - mock: { - image: evaluate.stubContentFunction('image'), - }, - }); - - const extraDependencies = { - wikiData: { - albumData: [ - {directory: 'cool-album', name: 'Cool Album', color: '#123456'}, - ], - }, - - to: (key, ...args) => `to-${key}/${args.join('/')}`, - }; - - const quickSnapshot = (message, content, slots) => - evaluate.snapshot(message, { - name: 'transformContent', - args: [content], - extraDependencies, - slots, - }); - - quickSnapshot( - 'two text paragraphs', - `Hello, world!\n` + - `Wow, this is very cool.`); - - quickSnapshot( - 'links to a thing', - `This is [[album:cool-album|my favorite album]].\n` + - `That's right, [[album:cool-album]]!`); - - quickSnapshot( - 'indent on a directly following line', - `<div>\n` + - ` <span>Wow!</span>\n` + - `</div>`); - - quickSnapshot( - 'indent on an indierctly following line', - `Some text.\n` + - `Yes, some more text.\n` + - `\n` + - ` I am hax0rz!!\n` + - ` All yor base r blong 2 us.\n` + - `\n` + - `Aye.\n` + - `Aye aye aye.`); - - quickSnapshot( - 'hanging indent list', - `Hello!\n` + - `\n` + - `* I am a list item and I\n` + - ` go on and on and on\n` + - ` and on and on and on.\n` + - `\n` + - `* I am another list item.\n` + - ` Yeah.\n` + - `\n` + - `In-between!\n` + - `\n` + - `* Spooky,\n` + - ` spooky, I say!\n` + - `* Following list item.\n` + - ` No empty line around me.\n` + - `* Very cool.\n` + - ` So, so cool.\n` + - `\n` + - `Goodbye!`); - - quickSnapshot( - 'inline images', - `<img src="snooping.png"> as USUAL...\n` + - `What do you know? <img src="cowabunga.png" width="24" height="32">\n` + - `[[album:cool-album|I'm on the left.]]<img src="im-on-the-right.jpg">\n` + - `<img src="im-on-the-left.jpg">[[album:cool-album|I'm on the right.]]\n` + - `Media time! <img src="media/misc/interesting.png"> Oh yeah!\n` + - `<img src="must.png"><img src="stick.png"><img src="together.png">\n` + - `And... all done! <img src="end-of-source.png">`); - - quickSnapshot( - 'non-inline image #1', - `<img src="spark.png">`); - - quickSnapshot( - 'non-inline image #2', - `Rad.\n` + - `<img src="spark.png">`); - - quickSnapshot( - 'non-inline image #3', - `<img src="spark.png">\n` + - `Baller.`); - - quickSnapshot( - 'dates', - `[[date:2023-04-13]] Yep!\n` + - `Very nice: [[date:25 October 2413]]`); - - quickSnapshot( - 'super basic string', - `Neat listing: [[string:listingPage.listAlbums.byDate.title]]`); - - quickSnapshot( - 'basic markdown', - `Hello *world!* This is **SO COOL.**`); - - quickSnapshot( - 'escape entire tag', - `\\[[album:cool-album|spooky]] [[album:cool-album|scary]]`); - - quickSnapshot( - 'escape end of tag', - `My favorite album is [[album:cool-album|[Tactical Omission\\]]].\n` + - `Your favorite album is [[album:cool-album|[Tactical Wha-Huh-Now]]].`); - - quickSnapshot( - 'escape markdown', - `What will it be, *ye fool?* \\*arr*`); - - quickSnapshot( - 'lyrics - basic line breaks', - `Hey, ho\n` + - `And away we go\n` + - `Truly, music\n` + - `\n` + - `(Oh yeah)\n` + - `(That's right)`, - {mode: 'lyrics'}); - - quickSnapshot( - 'lyrics - repeated and edge line breaks', - `\n\nWell, you know\nHow it goes\n\n\nYessiree\n\n\n`, - {mode: 'lyrics'}); - - quickSnapshot( - 'lyrics - line breaks around tags', - `The date be [[date:13 April 2004]]\n` + - `I say, the date be [[date:13 April 2004]]\n` + - `[[date:13 April 2004]]\n` + - `[[date:13 April 2004]][[date:13 April 2004]][[date:13 April 2004]]\n` + - `(Aye!)\n` + - `\n` + - `[[date:13 April 2004]]\n` + - `[[date:13 April 2004]][[date:13 April 2004]]\n` + - `[[date:13 April 2004]]\n` + - `\n` + - `[[date:13 April 2004]]\n` + - `[[date:13 April 2004]], and don't ye forget it`, - {mode: 'lyrics'}); - - quickSnapshot( - 'emails', - `Email cute dogs to qznebula@protonmail.com please.\n` + - `Just kidding... [unless?](mailto:qznebula@protonmail.com)`); - - quickSnapshot( - `absorb punctuation`, - `Don't you think this is an [interesting pull request](https://github.com/hsmusic/hsmusic-wiki/pull/567), Steve?\n` + - `Aren't you [interested](https://github.com/hsmusic/hsmusic-wiki/pull/567)... in [checking it out](https://github.com/hsmusic/hsmusic-wiki/pull/567)?!!`); - - // TODO: Snapshots for mode: inline - // TODO: Snapshots for mode: single-link -}); |