test(web): drop URL-echo and scaffold tests, merge repeated cases into tables (#8300)

Client tests that only restated a function's URL, or asserted on the value
their own mock returned, are gone; what those functions do beyond the URL
(escaping an id, leaving out an empty note, paging) keeps a test. Repeated
cases in the player store, row keyboard handling, public routes, register
refusals and others are tables. The shuffle test used an rng that never
swapped, so it could not fail; it now pins the order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 16:46:39 -05:00
co-authored by Claude Opus 5.5
parent 5d2c533074
commit 4c4ddf741e
35 changed files with 280 additions and 1508 deletions
@@ -93,24 +93,16 @@ describe('PlaylistTrackRow', () => {
).not.toBeInTheDocument();
});
test('ArrowDown on the reorder handle calls onMove(pos, pos+1)', async () => {
test.each([
['ArrowDown', 3],
['ArrowUp', 1]
])('%s on the reorder handle moves the row one place', async (key, to) => {
const onMove = vi.fn();
render(PlaylistTrackRow, {
props: { row: live, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn(), onMove }
});
const handle = screen.getByLabelText(/reorder track/i);
await fireEvent.keyDown(handle, { key: 'ArrowDown' });
expect(onMove).toHaveBeenCalledWith(2, 3);
});
test('ArrowUp on the reorder handle calls onMove(pos, pos-1)', async () => {
const onMove = vi.fn();
render(PlaylistTrackRow, {
props: { row: live, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn(), onMove }
});
const handle = screen.getByLabelText(/reorder track/i);
await fireEvent.keyDown(handle, { key: 'ArrowUp' });
expect(onMove).toHaveBeenCalledWith(2, 1);
await fireEvent.keyDown(screen.getByLabelText(/reorder track/i), { key });
expect(onMove).toHaveBeenCalledWith(2, to);
});
test('greyed-out + strikethrough when track_id is null', () => {