« 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: ebd3be5811471413a6933f3599e3a320126db9e6 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import t from 'tap';
import {testContentFunctions} from '#test-lib';

testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => {
  await evaluate.load();

  const quickSnapshot = (message, slots) =>
    evaluate.snapshot(message, {
      name: 'linkContribution',
      multiple: [
        {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,
    });

  quickSnapshot('showContribution & showIcons (inline)', {
    showContribution: true,
    showIcons: true,
    iconMode: 'inline',
  });

  quickSnapshot('showContribution & showIcons (tooltip)', {
    showContribution: true,
    showIcons: true,
    iconMode: 'tooltip',
  });

  quickSnapshot('only showContribution', {
    showContribution: true,
  });

  quickSnapshot('only showIcons (inline)', {
    showIcons: true,
    iconMode: 'inline',
  });

  quickSnapshot('only showIcons (tooltip)', {
    showContribution: true,
    showIcons: true,
    iconMode: 'tooltip',
  });

  quickSnapshot('no accents', {});

  evaluate.snapshot('loads of links (inline)', {
    name: 'linkContribution',
    args: [
      {who: {name: 'Lorem Ipsum Lover', directory: 'lorem-ipsum-lover', urls: [
        'https://loremipsum.io',
        'https://loremipsum.io/generator/',
        'https://loremipsum.io/#meaning',
        'https://loremipsum.io/#usage-and-examples',
        'https://loremipsum.io/#controversy',
        'https://loremipsum.io/#when-to-use-lorem-ipsum',
        'https://loremipsum.io/#lorem-ipsum-all-the-things',
        'https://loremipsum.io/#original-source',
      ]}, what: null},
    ],
    slots: {showIcons: true},
  });

  evaluate.snapshot('loads of links (tooltip)', {
    name: 'linkContribution',
    args: [
      {who: {name: 'Lorem Ipsum Lover', directory: 'lorem-ipsum-lover', urls: [
        'https://loremipsum.io',
        'https://loremipsum.io/generator/',
        'https://loremipsum.io/#meaning',
        'https://loremipsum.io/#usage-and-examples',
        'https://loremipsum.io/#controversy',
        'https://loremipsum.io/#when-to-use-lorem-ipsum',
        'https://loremipsum.io/#lorem-ipsum-all-the-things',
        'https://loremipsum.io/#original-source',
      ]}, what: null},
    ],
    slots: {showIcons: true, iconMode: 'tooltip'},
  });

  quickSnapshot('no preventWrapping', {
    showContribution: true,
    showIcons: true,
    preventWrapping: false,
  });
});