From 18aba34c08af9a8a15267e54e0c8b8a6e9d57238 Mon Sep 17 00:00:00 2001 From: Logan Date: Sun, 16 Aug 2026 14:51:07 -0400 Subject: [PATCH] test(e2e): a track plays the list it is in, not a queue of one e7748f1 made double-click and single-row Play queue the list as displayed with startIndex on that row; this frozen spec still asserted a queue of one, and was the only failure in both the chromium and webkit runs on main. It asserts the new contract instead: more than one track queued, currentIndex on the row that was activated, and the panel showing that queue rather than some other one. --- e2e/specs/playback.spec.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/e2e/specs/playback.spec.ts b/e2e/specs/playback.spec.ts index f5f5f19..fe8aa62 100644 --- a/e2e/specs/playback.spec.ts +++ b/e2e/specs/playback.spec.ts @@ -92,7 +92,7 @@ test.describe('queue', () => { await app.getByTestId('nav-tracks').click(); }); - test('playing a track populates the queue panel', async ({ app }) => { + test('playing a track queues the list it is in', async ({ app }) => { await resetEvents(app); await longRow(app).dblclick(); await waitForEvent(app, 'QueueChanged'); @@ -105,15 +105,23 @@ test.describe('queue', () => { await queueToggle.click(); - await expect(app.getByTestId('queue-row')).toHaveCount(1); + // Activating one row plays the list that row is in, from that row — + // the library as displayed, not a queue of one. The row's own + // position is what `currentIndex` points at. + const state = await callBinding<{ + tracks: { title: string }[]; + currentIndex: number; + }>(app, 'queue.Queue.GetState'); - const state = await callBinding<{ tracks: unknown[] }>( - app, - 'queue.Queue.GetState', + expect(state.tracks.length).toBeGreaterThan(1); + expect(state.tracks[state.currentIndex]?.title).toContain(LONG_TRACK); + + // The panel shows that queue rather than some other one: every + // fixture track fits on screen, so the counts are comparable. + await expect(app.getByTestId('queue-row')).toHaveCount( + state.tracks.length, ); - expect(state.tracks).toHaveLength(1); - // Shut it again, and wait until it really is shut. These specs // share one backend process in file order, the panel's width is // animated, and the transport slides while it closes — a click