{ const before = await canvas.findByRole('button', { name: 'before' }); const after = await canvas.findByRole('button', { name: 'after' }); const leftArrow = await canvas.findByRole('button', { name: 'Scroll left' }); await waitFor(() => { expect(leftArrow).toBeDisabled(); }); before.focus(); await userEvent.tab(); await expect(after).toHaveFocus(); }} >
{ const before = await canvas.findByRole('button', { name: 'before' }); const rightArrow = await canvas.findByRole('button', { name: 'Scroll right' }); await waitFor(() => { expect(rightArrow).not.toBeDisabled(); }); before.focus(); await userEvent.tab(); await expect(rightArrow).toHaveFocus(); }} >
{#each [...Array(20).keys()] as i (i)}
{i}
{/each}