« 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: 10d225cdd5a20ae36448b51b4e92bca1a29f8e2d (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({
    name: 'generateContributionLinks',
    args: [contributions, {showContribution: true, showIcons: true}],
  });

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

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

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