test: a list key waits for the list's registration, not only its rows
gate / frontend (push) Successful in 6m5s
gate / backend (push) Successful in 7m10s

The server gate's frontend job went red on 0.96.0: PlexPlaylistView's j/Delete
test pressed j after the rows painted but before useListNav's passive effect
registered the list, so the key did nothing on the slower runner. Every test
that presses a list key after an async load now waits for [data-nav-list] on
its list first (PlexPlaylistView, Playlists, Home, PlexDiscover). Checked
against a 30 ms delayed registration: the old tests fail, the new ones pass.
This commit is contained in:
2026-09-27 23:01:57 +02:00
parent ffcea0cb07
commit 0f9ed7cdbf
4 changed files with 20 additions and 7 deletions
@@ -289,8 +289,9 @@ describe("PlexDiscover · keyboard", () => {
);
await screen.findAllByText("Random Pick");
// Five rails (continue, recently watched, recently added, because-you-watched, surprise) + genres.
// Registered by a passive effect, which can land after the cards paint.
await waitFor(() => expect(document.querySelectorAll("[data-nav-list]")).toHaveLength(6));
const lists = [...document.querySelectorAll("[data-nav-list]")];
expect(lists.length).toBe(6);
// …and each holds its cards as items: the genre tiles too, not only the posters.
expect(lists.every((list) => list.querySelector("[data-nav-index]"))).toBe(true);
const step = () => {