From 4c3caa297be6f73f07821d2dab4071cf239712b4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 31 Jul 2024 09:33:53 -0300 Subject: test: generateAlbumTrackList: track sections (snapshot) --- .../snapshot/generateAlbumTrackList.js.test.cjs | 25 ++++++++++++++++++++++ test/snapshot/generateAlbumTrackList.js | 18 ++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tap-snapshots/test/snapshot/generateAlbumTrackList.js.test.cjs b/tap-snapshots/test/snapshot/generateAlbumTrackList.js.test.cjs index 10ab17c4..40a8017d 100644 --- a/tap-snapshots/test/snapshot/generateAlbumTrackList.js.test.cjs +++ b/tap-snapshots/test/snapshot/generateAlbumTrackList.js.test.cjs @@ -14,6 +14,31 @@ exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList ` +exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList (snapshot) > basic behavior, with descriptions 1`] = ` +
+
+ First section: (~1:00) + +
+
+

Why yes!

+
    +
  • (0:20) Track 1
  • +
  • [mocked: generateAlbumTrackListMissingDuration - slots: {}] Track 2
  • +
  • (0:40) Track 3
  • +
+
+
+ Second section: + +
+
+

How contentful, this is.

+ +
+
+` + exports[`test/snapshot/generateAlbumTrackList.js > TAP > generateAlbumTrackList (snapshot) > basic behavior, with track sections 1`] = `
diff --git a/test/snapshot/generateAlbumTrackList.js b/test/snapshot/generateAlbumTrackList.js index a7c3f591..e09f1c4a 100644 --- a/test/snapshot/generateAlbumTrackList.js +++ b/test/snapshot/generateAlbumTrackList.js @@ -6,6 +6,9 @@ testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) mock: { generateAlbumTrackListMissingDuration: evaluate.stubContentFunction('generateAlbumTrackListMissingDuration'), + + image: + evaluate.stubContentFunction('image'), }, }); @@ -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'}, -- cgit 1.3.0-6-gf8a5