Announces pausing and resuming the hero slide show
The pause button only changed its name, which screen readers often do not read for the focused button. The live region now also says when the slide show is paused or plays again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,16 +7,33 @@ import useHeroSlider from './useHeroSlider';
|
||||
describe('useHeroSlider', () => {
|
||||
it('meldt een wissel door de bezoeker, een automatische niet', () => {
|
||||
const { result } = renderHook(() => useHeroSlider(8));
|
||||
expect(result.current.announce).toBe(false);
|
||||
expect(result.current.announcement).toBeNull();
|
||||
|
||||
act(() => result.current.next());
|
||||
expect(result.current).toMatchObject({ active: 1, announce: true });
|
||||
expect(result.current).toMatchObject({
|
||||
active: 1,
|
||||
announcement: 'slide',
|
||||
});
|
||||
|
||||
act(() => result.current.advance());
|
||||
expect(result.current).toMatchObject({ active: 2, announce: false });
|
||||
expect(result.current).toMatchObject({ active: 2, announcement: null });
|
||||
|
||||
act(() => result.current.prev());
|
||||
expect(result.current).toMatchObject({ active: 1, announce: true });
|
||||
expect(result.current).toMatchObject({
|
||||
active: 1,
|
||||
announcement: 'slide',
|
||||
});
|
||||
});
|
||||
|
||||
it('meldt pauzeren en afspelen via de knop', () => {
|
||||
const { result } = renderHook(() => useHeroSlider(8));
|
||||
act(() => result.current.toggleStopped());
|
||||
expect(result.current.announcement).toBe('paused');
|
||||
act(() => result.current.toggleStopped());
|
||||
expect(result.current.announcement).toBe('playing');
|
||||
// De volgende automatische wissel maakt de melding weer leeg
|
||||
act(() => result.current.advance());
|
||||
expect(result.current.announcement).toBeNull();
|
||||
});
|
||||
|
||||
it('loopt rond aan beide kanten', () => {
|
||||
|
||||
Reference in New Issue
Block a user