diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_music_queue.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_music_queue.py | 27 |
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 |