« get me outta code hell

test: test missing tracks property in album.trackSections - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-01 09:41:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-01 09:42:11 -0300
commitdfcf911501211bbfc64b8ce6a964b70c6406447f (patch)
treef0e4c08f90a46af2cbda0f9f37701b4c4859446b
parentb09540f108de841a067f8f6a8e62c82335221ee9 (diff)
test: test missing tracks property in album.trackSections
-rw-r--r--test/unit/data/things/album.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/unit/data/things/album.js b/test/unit/data/things/album.js
index 0695fdb..c5f7fa9 100644
--- a/test/unit/data/things/album.js
+++ b/test/unit/data/things/album.js
@@ -198,7 +198,7 @@ t.test(`Album.coverArtFileExtension`, t => {
 });
 
 t.test(`Album.tracks`, t => {
-  t.plan(4);
+  t.plan(5);
 
   const album = new Album();
   const track1 = stubTrack('track1');
@@ -237,6 +237,18 @@ t.test(`Album.tracks`, t => {
 
   t.same(album.tracks, [track1, track2, track3],
     `Album.tracks #4: filters out references without matches`);
+
+  album.trackSections = [
+    {tracks: ['track:track1']},
+    {},
+    {tracks: ['track:track2']},
+    {},
+    {},
+    {tracks: ['track:track3']},
+  ];
+
+  t.same(album.tracks, [track1, track2, track3],
+    `Album.tracks #5: skips missing tracks property`);
 });
 
 t.test(`Album.trackSections`, t => {