« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/snapshot/generateAlbumTrackList.js30
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,
     }],