From 64b4a5e6355872c49429f1d19c3403277d032b6c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 24 Jun 2023 17:55:00 -0300 Subject: content: linkContribution: take standard {who, what} object This is what's used for all contributions anyway, so no need to have every call to linkContribution manually destructure whatever contribution is being provided. --- test/snapshot/linkContribution.js | 51 ++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'test/snapshot') diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js index 44033ad3..10b1bd08 100644 --- a/test/snapshot/linkContribution.js +++ b/test/snapshot/linkContribution.js @@ -2,37 +2,33 @@ 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]}, + {args: [ + {who: { + name: 'Clark Powell', + directory: 'clark-powell', + urls: ['https://soundcloud.com/plazmataz'], + }, what: null}, + ]}, + {args: [ + {who: { + name: 'Grounder & Scratch', + directory: 'the-big-baddies', + urls: [], + }, what: 'Snooping'}, + ]}, + {args: [ + {who: { + name: 'Toby Fox', + directory: 'toby-fox', + urls: ['https://tobyfox.bandcamp.com/', 'https://toby.fox/'], + }, what: 'Arrangement'}, + ]}, ], slots, }); @@ -55,7 +51,7 @@ testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { evaluate.snapshot('loads of links', { name: 'linkContribution', args: [ - {name: 'Lorem Ipsum Lover', directory: 'lorem-ipsum-lover', urls: [ + {who: {name: 'Lorem Ipsum Lover', directory: 'lorem-ipsum-lover', urls: [ 'https://loremipsum.io', 'https://loremipsum.io/generator/', 'https://loremipsum.io/#meaning', @@ -64,8 +60,7 @@ testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => { 'https://loremipsum.io/#when-to-use-lorem-ipsum', 'https://loremipsum.io/#lorem-ipsum-all-the-things', 'https://loremipsum.io/#original-source', - ]}, - null, + ]}, what: null}, ], slots: {showIcons: true}, }); -- cgit 1.3.0-6-gf8a5