From 01fca1864f58067ec95590700b5dead24fd2dc73 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 3 Apr 2024 12:58:49 -0300 Subject: data: simplify withAlbum, withFlashAct, remove notFoundMode --- test/unit/data/composite/things/track/withAlbum.js | 55 +--------------------- 1 file changed, 1 insertion(+), 54 deletions(-) (limited to 'test/unit') 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`); -}); -- cgit 1.3.0-6-gf8a5