From ba41071d9b6647b2e12a78de774a55aef5b87876 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 13 Jun 2023 12:54:20 -0300 Subject: test: generateContributionLinks -> linkContribution --- test/snapshot/linkContribution.js | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/snapshot/linkContribution.js (limited to 'test/snapshot/linkContribution.js') diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js new file mode 100644 index 00000000..758fa264 --- /dev/null +++ b/test/snapshot/linkContribution.js @@ -0,0 +1,54 @@ +import t from 'tap'; +import {testContentFunctions} from '../lib/content-function.js'; + +testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { + const who1 = { + name: 'Clark Powell', + directory: 'clark-powell', + urls: ['https://soundcloud.com/plazmataz'], + }; + + const who2 = { + name: 'Grounder & Scratch', + directory: 'the-big-baddies', + urls: [], + }; + + const who3 = { + name: 'Toby Fox', + directory: 'toby-fox', + urls: ['https://tobyfox.bandcamp.com/', 'https://toby.fox/'], + }; + + const what1 = null; + const what2 = 'Snooping'; + const what3 = 'Arrangement'; + + await evaluate.load(); + + const quickSnapshot = (message, slots) => + evaluate.snapshot(message, { + name: 'linkContribution', + multiple: [ + {args: [who1, what1]}, + {args: [who2, what2]}, + {args: [who3, what3]}, + ], + slots, + }); + + quickSnapshot('showContribution & showIcons', { + showContribution: true, + showIcons: true, + }); + + quickSnapshot('only showContribution', { + showContribution: true, + }); + + quickSnapshot('only showIcons', { + showIcons: true, + }); + + quickSnapshot('no accents', {}); +}); -- cgit 1.3.0-6-gf8a5