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
|
import t from 'tap';
import * as html from '#html';
import {testContentFunctions} from '#test-lib';
testContentFunctions(t, 'generatePreviousNextLinks (snapshot)', async (t, evaluate) => {
await evaluate.load();
const quickSnapshot = (message, slots) =>
evaluate.snapshot(message, {
name: 'generatePreviousNextLinks',
slots,
postprocess: template => template.content.join('\n'),
});
quickSnapshot('basic behavior', {
previousLink: evaluate.stubTemplate('previous'),
nextLink: evaluate.stubTemplate('next'),
});
quickSnapshot('previous missing', {
nextLink: evaluate.stubTemplate('next'),
});
quickSnapshot('next missing', {
previousLink: evaluate.stubTemplate('previous'),
});
quickSnapshot('neither link present', {});
quickSnapshot('disable id', {
previousLink: evaluate.stubTemplate('previous'),
nextLink: evaluate.stubTemplate('next'),
id: false,
});
});
|