diff options
Diffstat (limited to 'test/snapshot/generateAlbumTrackList.js')
-rw-r--r-- | test/snapshot/generateAlbumTrackList.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/snapshot/generateAlbumTrackList.js b/test/snapshot/generateAlbumTrackList.js index 08b31902..e09f1c4a 100644 --- a/test/snapshot/generateAlbumTrackList.js +++ b/test/snapshot/generateAlbumTrackList.js @@ -6,17 +6,20 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) mock: { generateAlbumTrackListMissingDuration: evaluate.stubContentFunction('generateAlbumTrackListMissingDuration'), + + image: + evaluate.stubContentFunction('image'), }, }); const contribs1 = [ - {artist: {name: 'Apricot', directory: 'apricot', urls: null}}, + {artist: {name: 'Apricot', directory: 'apricot', urls: []}}, ]; const contribs2 = [ - {artist: {name: 'Apricot', directory: 'apricot', urls: null}}, + {artist: {name: 'Apricot', directory: 'apricot', urls: []}}, {artist: {name: 'Peach', directory: 'peach', urls: ['https://peach.bandcamp.com/']}}, - {artist: {name: 'Cerise', directory: 'cerise', urls: null}}, + {artist: {name: 'Cerise', directory: 'cerise', urls: []}}, ]; const color1 = '#fb07ff'; @@ -46,6 +49,16 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) tracks, }; + const albumWithTrackSectionDescriptions = { + color: color1, + artistContribs: contribs1, + trackSections: [ + {name: 'First section', tracks: tracks.slice(0, 3), description: `Why yes!`}, + {name: 'Second section', tracks: tracks.slice(3), description: `How *contentful,* this is.`}, + ], + tracks, + }; + const albumWithNoDuration = { color: color1, artistContribs: contribs1, @@ -63,6 +76,11 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) args: [albumWithoutTrackSections], }); + evaluate.snapshot(`basic behavior, with descriptions`, { + name: 'generateAlbumTrackList', + args: [albumWithTrackSectionDescriptions], + }); + evaluate.snapshot(`collapseDurationScope: never`, { name: 'generateAlbumTrackList', slots: {collapseDurationScope: 'never'}, |