diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/snapshot/linkContribution.js | 51 | ||||
-rw-r--r-- | test/unit/content/dependencies/linkContribution.js | 12 |
2 files changed, 29 insertions, 34 deletions
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}, }); diff --git a/test/unit/content/dependencies/linkContribution.js b/test/unit/content/dependencies/linkContribution.js index 6f3150f7..bed2b6d5 100644 --- a/test/unit/content/dependencies/linkContribution.js +++ b/test/unit/content/dependencies/linkContribution.js @@ -64,9 +64,9 @@ t.test('generateContributionLinks (unit)', async t => { evaluate({ name: 'linkContribution', multiple: [ - {args: [who1, what1]}, - {args: [who2, what2]}, - {args: [who3, what3]}, + {args: [{who: who1, what: what1}]}, + {args: [{who: who2, what: what2}]}, + {args: [{who: who3, what: what3}]}, ], slots, }); @@ -112,9 +112,9 @@ t.test('generateContributionLinks (unit)', async t => { evaluate({ name: 'linkContribution', multiple: [ - {args: [who1, what1]}, - {args: [who2, what2]}, - {args: [who3, what3]}, + {args: [{who: who1, what: what1}]}, + {args: [{who: who2, what: what2}]}, + {args: [{who: who3, what: what3}]}, ], slots, }); |