« get me outta code hell

data: simplify withAlbum, withFlashAct, remove notFoundMode - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-03 12:58:49 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-03 13:44:00 -0300
commit01fca1864f58067ec95590700b5dead24fd2dc73 (patch)
tree1dd214b38f1692b6c6122c8244a328b595f91628 /test
parentc730fce11ed3cd57cca6b5290bb83adeb6100dde (diff)
data: simplify withAlbum, withFlashAct, remove notFoundMode
Diffstat (limited to 'test')
-rw-r--r--test/unit/data/composite/things/track/withAlbum.js55
1 files changed, 1 insertions, 54 deletions
diff --git a/test/unit/data/composite/things/track/withAlbum.js b/test/unit/data/composite/things/track/withAlbum.js
index 30f8cc5d..d822f318 100644
--- a/test/unit/data/composite/things/track/withAlbum.js
+++ b/test/unit/data/composite/things/track/withAlbum.js
@@ -40,7 +40,7 @@ t.test(`withAlbum: basic behavior`, t => {
     null);
 });
 
-t.test(`withAlbum: early exit conditions (notFoundMode: null)`, t => {
+t.test(`withAlbum: early exit conditions`, t => {
   t.plan(4);
 
   const composite = compositeFrom({
@@ -89,56 +89,3 @@ t.test(`withAlbum: early exit conditions (notFoundMode: null)`, t => {
     null,
     `early exits if albumData is null`);
 });
-
-t.test(`withAlbum: early exit conditions (notFoundMode: exit)`, t => {
-  t.plan(4);
-
-  const composite = compositeFrom({
-    compose: false,
-    steps: [
-      withAlbum({
-        notFoundMode: input.value('exit'),
-      }),
-
-      exposeConstant({
-        value: input.value('bimbam'),
-      }),
-    ],
-  });
-
-  const fakeTrack1 = {directory: 'foo'};
-  const fakeTrack2 = {directory: 'bar'};
-  const fakeAlbum = {directory: 'baz', tracks: [fakeTrack1]};
-
-  t.equal(
-    composite.expose.compute({
-      albumData: [fakeAlbum],
-      this: fakeTrack1,
-    }),
-    'bimbam',
-    `does not early exit if albumData is present and contains the track`);
-
-  t.equal(
-    composite.expose.compute({
-      albumData: [fakeAlbum],
-      this: fakeTrack2,
-    }),
-    null,
-    `early exits if albumData is present and does not contain the track`);
-
-  t.equal(
-    composite.expose.compute({
-      albumData: [],
-      this: fakeTrack1,
-    }),
-    null,
-    `early exits if albumData is empty array`);
-
-  t.equal(
-    composite.expose.compute({
-      albumData: null,
-      this: fakeTrack1,
-    }),
-    null,
-    `early exits if albumData is null`);
-});