« get me outta code hell

linkTemplate.js « snapshots « test - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshots/linkTemplate.js
blob: 0dcf5b61be1b64d0fb409395e01b3aed9d1c12a4 (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
import t from 'tap';

import {testContentFunctions} from './_support.js';

testContentFunctions(t, 'linkTemplate', (t, evaluate) => {
  evaluate.snapshot({
    name: 'linkTemplate',
    extraDependencies: {
      getColors: c => ({primary: c + 'ff', dim: c + '77'}),
    },
  },
    v => v
      .slot('color', '#123456')
      .slot('href', 'https://hsmusic.wiki/media/cool file.pdf')
      .slot('hash', 'fooey')
      .slot('attributes', {class: 'dog', id: 'cat1'})
      .slot('content', 'My Cool Link'));

  evaluate.snapshot({
    name: 'linkTemplate',
    extraDependencies: {
      to: (...path) => '/c*lzone/' + path.join('/') + '/',
      appendIndexHTML: true,
    },
  },
    v => v
      .slot('path', ['myCoolPath', 'ham', 'pineapple', 'tomato']));
});