« get me outta code hell

generateContributionLinks.js « snapshot « test - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/generateContributionLinks.js
blob: deecf9efb9545621ee2919ab3094de71878b5f2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import t from 'tap';
import {testContentFunctions} from '../lib/content-function.js';

testContentFunctions(t, 'generateContributionLinks (snapshot)', async (t, evaluate) => {
  const artist1 = {
    name: 'Clark Powell',
    directory: 'clark-powell',
    urls: ['https://soundcloud.com/plazmataz'],
  };

  const artist2 = {
    name: 'Grounder & Scratch',
    directory: 'the-big-baddies',
    urls: [],
  };

  const artist3 = {
    name: 'Toby Fox',
    directory: 'toby-fox',
    urls: ['https://tobyfox.bandcamp.com/', 'https://toby.fox/'],
  };

  const contributions = [
    {who: artist1, what: null},
    {who: artist2, what: 'Snooping'},
    {who: artist3, what: 'Arrangement'},
  ];

  await evaluate.load();

  evaluate.snapshot('showContribution & showIcons', {
    name: 'generateContributionLinks',
    args: [contributions, {showContribution: true, showIcons: true}],
  });

  evaluate.snapshot('only showContribution', {
    name: 'generateContributionLinks',
    args: [contributions, {showContribution: true, showIcons: false}],
  });

  evaluate.snapshot('only showIcons', {
    name: 'generateContributionLinks',
    args: [contributions, {showContribution: false, showIcons: true}],
  });

  evaluate.snapshot('no accents', {
    name: 'generateContributionLinks',
    args: [contributions, {showContribution: false, showIcons: false}],
  });
});