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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user