From ebdc62e0bb57b2e9e0f81f2a8804940c76f007c8 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Mar 2024 10:28:17 -0300 Subject: test: linkExternal: match sort, write some testing guidelines --- test/snapshot/linkExternal.js | 61 ++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 15 deletions(-) (limited to 'test/snapshot') diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js index 6c43ea35..35af656b 100644 --- a/test/snapshot/linkExternal.js +++ b/test/snapshot/linkExternal.js @@ -26,29 +26,60 @@ testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => { } }; + // Try to comprehensively test every regular expression + // (in `match` and extractions like `handle` or `details`). + + // 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: bandcamp + 'https://music.solatrus.com/', 'https://homestuck.bandcamp.com/', - 'https://soundcloud.com/plazmataz', - 'https://aeritus.tumblr.com/', - 'https://twitter.com/awkwarddoesart', + + // platform: deviantart 'https://www.deviantart.com/chesswanderlust-sama', - 'https://en.wikipedia.org/wiki/Haydn_Quartet_(vocal_ensemble)', - 'https://www.poetryfoundation.org/poets/christina-rossetti', + + // platform: fandom + 'https://mspaintadventures.fandom.com/', + 'https://mspaintadventures.fandom.com/wiki/', + 'https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary', + 'https://community.fandom.com/', + 'https://community.fandom.com/wiki/', + 'https://community.fandom.com/wiki/Community_Central', + + // platform: instagram 'https://www.instagram.com/levc_egm/', + + // platform: mastodon + 'https://types.pl/', + + // platform: newgrounds + 'https://buzinkai.newgrounds.com/', + + // platform: patreon 'https://www.patreon.com/CecilyRenns', + + // platform: poetryFoundation + 'https://www.poetryfoundation.org/poets/christina-rossetti', + + // platform: soundcloud + 'https://soundcloud.com/plazmataz', + + // platform: spotify 'https://open.spotify.com/artist/63SNNpNOicDzG3LY82G4q3', - 'https://buzinkai.newgrounds.com/', - // Just one custom domain of each platform is OK here - 'https://music.solatrus.com/', - 'https://types.pl/', + // platform: tumblr + 'https://aeritus.tumblr.com/', - 'https://community.fandom.com/', - 'https://community.fandom.com/wiki/', - 'https://community.fandom.com/wiki/Community_Central', - 'https://mspaintadventures.fandom.com/', - 'https://mspaintadventures.fandom.com/wiki/', - 'https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary', + // platform: twitter + 'https://twitter.com/awkwarddoesart', + + // platform: wikipedia + 'https://en.wikipedia.org/wiki/Haydn_Quartet_(vocal_ensemble)', ]); quickSnapshotAllStyles('album', [ -- cgit 1.3.0-6-gf8a5