« 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/generateAlbumAdditionalFilesList.js84
-rw-r--r--test/snapshot/linkThing.js2
-rw-r--r--test/unit/data/things/track.js5
3 files changed, 4 insertions, 87 deletions
diff --git a/test/snapshot/generateAlbumAdditionalFilesList.js b/test/snapshot/generateAlbumAdditionalFilesList.js
deleted file mode 100644
index c25e5682..00000000
--- a/test/snapshot/generateAlbumAdditionalFilesList.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import t from 'tap';
-
-import {testContentFunctions} from '#test-lib';
-import thingConstructors from '#things';
-
-const {Album} = thingConstructors;
-
-testContentFunctions(t, 'generateAlbumAdditionalFilesList (snapshot)', async (t, evaluate) => {
-  const sizeMap = {
-    'sburbwp_1280x1024.jpg': 2500,
-    'sburbwp_1440x900.jpg': null,
-    'sburbwp_1920x1080.jpg': null,
-    'Internet Explorer.gif': 1,
-    'Homestuck_Vol4_alt1.jpg': 1234567,
-    'Homestuck_Vol4_alt2.jpg': 1234567,
-    'Homestuck_Vol4_alt3.jpg': 1234567,
-  };
-
-  const extraDependencies = {
-    getSizeOfAdditionalFile: file =>
-      Object.entries(sizeMap)
-        .find(key => file.includes(key))
-        ?.at(1) ?? null,
-  };
-
-  await evaluate.load({
-    mock: {
-      image: evaluate.stubContentFunction('image'),
-    },
-  });
-
-  const album = new Album();
-  album.directory = 'exciting-album';
-
-  evaluate.snapshot('no additional files', {
-    extraDependencies,
-    name: 'generateAlbumAdditionalFilesList',
-    args: [album, []],
-  });
-
-  try {
-    evaluate.snapshot('basic behavior', {
-      extraDependencies,
-      name: 'generateAlbumAdditionalFilesList',
-      args: [
-        album,
-        [
-          {
-            title: 'SBURB Wallpaper',
-            files: [
-              'sburbwp_1280x1024.jpg',
-              'sburbwp_1440x900.jpg',
-              'sburbwp_1920x1080.jpg',
-            ],
-          },
-          {
-            title: 'Fake Section',
-            description: 'No sizes for these files',
-            files: [
-              'oops.mp3',
-              'Internet Explorer.gif',
-              'daisy.mp3',
-            ],
-          },
-          {
-            title: `Empty Section`,
-            description: `These files haven't been made available.`,
-          },
-          {
-            title: 'Alternate Covers',
-            description: 'This is just an example description.',
-            files: [
-              'Homestuck_Vol4_alt1.jpg',
-              'Homestuck_Vol4_alt2.jpg',
-              'Homestuck_Vol4_alt3.jpg',
-            ],
-          },
-        ],
-      ],
-    });
-  } catch (error) {
-    console.log(error);
-  }
-});
diff --git a/test/snapshot/linkThing.js b/test/snapshot/linkThing.js
index 502db6d7..9b5cff33 100644
--- a/test/snapshot/linkThing.js
+++ b/test/snapshot/linkThing.js
@@ -20,7 +20,7 @@ testContentFunctions(t, 'linkThing (snapshot)', async (t, evaluate) => {
   });
 
   quickSnapshot('preferShortName', {
-    args: ['localized.tag', {
+    args: ['localized.artTagGallery', {
       directory: 'five-oceanfalls',
       name: 'Five (Oceanfalls)',
       nameShort: 'Five',
diff --git a/test/unit/data/things/track.js b/test/unit/data/things/track.js
index 983a5537..403dc064 100644
--- a/test/unit/data/things/track.js
+++ b/test/unit/data/things/track.js
@@ -1,5 +1,6 @@
 import t from 'tap';
 
+import {bindFind} from '#find';
 import thingConstructors from '#things';
 
 import {
@@ -662,13 +663,13 @@ t.test(`Track.otherReleases`, t => {
     `otherReleases #2: otherReleases of original release are its rereleases`);
 
   wikiData.trackData = [track1, track3, track2, track4];
-  linkWikiDataArrays();
+  linkWikiDataArrays({bindFind});
 
   t.same(track1.otherReleases, [track3, track2, track4],
     `otherReleases #3: otherReleases matches trackData order`);
 
   wikiData.trackData = [track3, track2, track1, track4];
-  linkWikiDataArrays();
+  linkWikiDataArrays({bindFind});
 
   t.same(track2.otherReleases, [track1, track3, track4],
     `otherReleases #4: otherReleases of rerelease are original track then other rereleases (1/3)`);