diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-06-24 18:14:25 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-06-24 18:14:25 -0300 |
commit | 004ff284cb54be664fd57337e3ab0a6ca8c607b3 (patch) | |
tree | 90fa1e71e0fd3719c425d2d9756e98a360966fad /test | |
parent | 13552d0c672984611cf4c64641b8fec971128b4a (diff) |
test: generateAlbumTrackList: snapshot dependencies too
Diffstat (limited to 'test')
-rw-r--r-- | test/snapshot/generateAlbumTrackList.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/test/snapshot/generateAlbumTrackList.js b/test/snapshot/generateAlbumTrackList.js index 055f189e..3fc95716 100644 --- a/test/snapshot/generateAlbumTrackList.js +++ b/test/snapshot/generateAlbumTrackList.js @@ -2,27 +2,28 @@ import t from 'tap'; import {testContentFunctions} from '../lib/content-function.js'; testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) => { - await evaluate.load({ - mock: { - generateAlbumTrackListItem: { - extraDependencies: ['html'], - data: track => track.name, - generate: (name, {html}) => - html.tag('li', `Item: ${name}`), - }, - }, - }); + await evaluate.load(); + + const contribs1 = [ + {who: {name: 'Apricot', directory: 'apricot', urls: null}}, + ]; + + const contribs2 = [ + {who: {name: 'Apricot', directory: 'apricot', urls: null}}, + {who: {name: 'Peach', directory: 'peach', urls: ['https://peach.bandcamp.com/']}}, + ]; const tracks = [ - {name: 'Track 1', duration: 20}, - {name: 'Track 2', duration: 30}, - {name: 'Track 3', duration: 40}, - {name: 'Track 4', duration: 5}, + {name: 'Track 1', directory: 't1', duration: 20, artistContribs: contribs1}, + {name: 'Track 2', directory: 't2', duration: 30, artistContribs: contribs1}, + {name: 'Track 3', directory: 't3', duration: 40, artistContribs: contribs1}, + {name: 'Track 4', directory: 't4', duration: 5, artistContribs: contribs2}, ]; evaluate.snapshot('basic behavior, with track sections', { name: 'generateAlbumTrackList', args: [{ + artistContribs: contribs1, trackSections: [ {name: 'First section', tracks: tracks.slice(0, 3)}, {name: 'Second section', tracks: tracks.slice(3)}, @@ -34,6 +35,7 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) evaluate.snapshot('basic behavior, default track section', { name: 'generateAlbumTrackList', args: [{ + artistContribs: contribs1, trackSections: [{isDefaultTrackSection: true, tracks}], tracks, }], |