aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_music_queue.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-16 12:10:25 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-16 12:10:25 +0200
commit9cbff21274604e37c0986d57937deef85819c396 (patch)
treebdfb55978bb105fd78d1d35db33ff8bb35457f67 /packages/meshbay-hub/tests/test_music_queue.py
parent2e973795383b71f63ae9e3bef0e5dfc7930b4c90 (diff)
downloadmeshbay-9cbff21274604e37c0986d57937deef85819c396.tar.gz
music: the playlist menus
One button in Music's sticky toolbar — load, create, delete, remove a track, sync now — and "add to playlist" on every cover and row. Both surfaces share one list, read from the manifest, so they open instantly with every node offline and no body is fetched until one is wanted. Submenus expand in place rather than flying out: the account menu's language list already does this, and a flyout has nowhere to go at 400px. The tracklist under "remove a track" loads when it is expanded. A name is typed into a field. Electron has no prompt — it throws. Also splits the two playback failures: a decode failure belongs to that file and keeps the bounded counter, a connection failure belongs to the group and skips all of its queued tracks at once. Six dead tracks are one more than the bound, which is where a playlist would otherwise stop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_music_queue.py')
-rw-r--r--packages/meshbay-hub/tests/test_music_queue.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/packages/meshbay-hub/tests/test_music_queue.py b/packages/meshbay-hub/tests/test_music_queue.py
index a53047d..5bf9e97 100644
--- a/packages/meshbay-hub/tests/test_music_queue.py
+++ b/packages/meshbay-hub/tests/test_music_queue.py
@@ -52,11 +52,12 @@ def test_playing_a_track_queues_its_album(steps):
assert s["nowPlaying"] == "A1-t2"
-def test_right_click_opens_the_three_queue_verbs(steps):
- """Three items, in the order the menu promises. Their labels are whatever
- the browser's locale renders, so this counts them rather than reading them
- — the point is that the menu opened and is not empty."""
- assert len(steps["append album 2"]["menu"]) == 3
+def test_right_click_opens_the_queue_verbs(steps):
+ """The menu opened and carries the three queue verbs, plus "add to
+ playlist" — which is why this counts four rather than three. Labels are
+ whatever the browser's locale renders, so counting is what this can assert;
+ `test_playlist_ui.py` is what checks the fourth one leads anywhere."""
+ assert len(steps["append album 2"]["menu"]) == 4
def test_add_to_queue_appends_and_leaves_the_playhead_alone(steps):
@@ -96,6 +97,22 @@ def test_play_all_replaces_everything(steps):
assert s["playing"] == 0
+def test_an_unreachable_group_is_skipped_whole_rather_than_one_track_at_a_time(steps):
+ """A regression playlists would otherwise introduce into correct code.
+
+ `MAX_CONSECUTIVE_FAILURES` is 5 and was sized for a corrupt file between
+ two good ones. A playlist whose next six tracks all come from one node that
+ is off hits that bound and stops on the sixth, with an error, and the
+ reader reads it as "the playlist is broken".
+
+ A connection failure is a property of the *group*, not of each of its
+ tracks in turn, so the group is marked down and all of its queued tracks go
+ in one step. Six dead tracks here, one more than the bound: without the
+ split this lands on the last of them instead of past them.
+ """
+ assert steps["an unreachable group is skipped whole"]["nowPlaying"] == "live-2"
+
+
# ── the wrappers, read rather than driven ────────────────────────────────────
#
# The probe proves the chain works for the group page. Search mounts the same