Skip to content

Commit 4c3caa2

Browse files
committed
test: generateAlbumTrackList: track sections (snapshot)
1 parent dd3ab62 commit 4c3caa2

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

tap-snapshots/test/snapshot/generateAlbumTrackList.js.test.cjs

+25
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@ exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList
1414
</ul>
1515
`
1616

17+
exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList (snapshot) > basic behavior, with descriptions 1`] = `
18+
<dl class="album-group-list">
19+
<dt class="content-heading" tabindex="0">
20+
<span class="content-heading-main-title">First section: (~1:00)</span>
21+
<template class="content-heading-sticky-title">First section:</template>
22+
</dt>
23+
<dd>
24+
<blockquote><p>Why yes!</p></blockquote>
25+
<ul>
26+
<li>(0:20) <a href="track/t1/">Track 1</a></li>
27+
<li>[mocked: generateAlbumTrackListMissingDuration - slots: {}] <a href="track/t2/">Track 2</a></li>
28+
<li>(0:40) <a href="track/t3/">Track 3</a></li>
29+
</ul>
30+
</dd>
31+
<dt class="content-heading" tabindex="0">
32+
<span class="content-heading-main-title">Second section:</span>
33+
<template class="content-heading-sticky-title">Second section:</template>
34+
</dt>
35+
<dd>
36+
<blockquote><p>How <em>contentful,</em> this is.</p></blockquote>
37+
<ul><li style="--primary-color: #ea2e83">[mocked: generateAlbumTrackListMissingDuration - slots: {}] <a href="track/t4/">Track 4</a> <span class="by"><span class="chunkwrap">by <span class="contribution nowrap"><a href="artist/apricot/">Apricot</a></span>,</span> <span class="chunkwrap"><span class="contribution nowrap"><a href="artist/peach/">Peach</a></span>,</span> <span class="chunkwrap">and <span class="contribution nowrap"><a href="artist/cerise/">Cerise</a></span></span></span></li></ul>
38+
</dd>
39+
</dl>
40+
`
41+
1742
exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList (snapshot) > basic behavior, with track sections 1`] = `
1843
<dl class="album-group-list">
1944
<dt class="content-heading" tabindex="0">

test/snapshot/generateAlbumTrackList.js

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate)
66
mock: {
77
generateAlbumTrackListMissingDuration:
88
evaluate.stubContentFunction('generateAlbumTrackListMissingDuration'),
9+
10+
image:
11+
evaluate.stubContentFunction('image'),
912
},
1013
});
1114

@@ -46,6 +49,16 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate)
4649
tracks,
4750
};
4851

52+
const albumWithTrackSectionDescriptions = {
53+
color: color1,
54+
artistContribs: contribs1,
55+
trackSections: [
56+
{name: 'First section', tracks: tracks.slice(0, 3), description: `Why yes!`},
57+
{name: 'Second section', tracks: tracks.slice(3), description: `How *contentful,* this is.`},
58+
],
59+
tracks,
60+
};
61+
4962
const albumWithNoDuration = {
5063
color: color1,
5164
artistContribs: contribs1,
@@ -63,6 +76,11 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate)
6376
args: [albumWithoutTrackSections],
6477
});
6578

79+
evaluate.snapshot(`basic behavior, with descriptions`, {
80+
name: 'generateAlbumTrackList',
81+
args: [albumWithTrackSectionDescriptions],
82+
});
83+
6684
evaluate.snapshot(`collapseDurationScope: never`, {
6785
name: 'generateAlbumTrackList',
6886
slots: {collapseDurationScope: 'never'},

0 commit comments

Comments
 (0)