« get me outta code hell

linkContribution.js « snapshot « test - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/linkContribution.js
blob: 758fa264805c0c37681b15d9a3f3fe0e9c8742f5 (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
51
52
53
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', {});
});