diff --git a/packages/renderer/src/lib/carousel/Carousel.spec.ts b/packages/renderer/src/lib/carousel/Carousel.spec.ts index 0103a9bc3bb08..263d2a5370707 100644 --- a/packages/renderer/src/lib/carousel/Carousel.spec.ts +++ b/packages/renderer/src/lib/carousel/Carousel.spec.ts @@ -129,3 +129,22 @@ test('carousel left and right buttons enabled when all items does not fit into s expect(left).toBeDisabled(); expect(right).toBeDisabled(); }); + +test('left and right buttons have hover class', async () => { + render(CarouselTest); + const card1 = screen.getByText('card 1'); + console.log(window.innerWidth); + expect(card1).toBeVisible(); + + let cards = screen.queryAllByText('card 2'); + expect(cards.length).toBe(0); + + cards = screen.queryAllByText('card 3'); + expect(cards.length).toBe(0); + + const left = screen.getByRole('button', { name: 'Rotate left' }); + const right = screen.getByRole('button', { name: 'Rotate right' }); + + expect(left).toHaveClass(/^hover:bg-/); + expect(right).toHaveClass(/^hover:bg-/); +}); diff --git a/packages/renderer/src/lib/carousel/Carousel.svelte b/packages/renderer/src/lib/carousel/Carousel.svelte index dd7cd72887824..66183981e4187 100644 --- a/packages/renderer/src/lib/carousel/Carousel.svelte +++ b/packages/renderer/src/lib/carousel/Carousel.svelte @@ -49,7 +49,7 @@ function rotateRight() { id="left" on:click="{rotateLeft}" aria-label="Rotate left" - class="h-8 w-8 mr-3 bg-gray-800 rounded-full disabled:bg-charcoal-700" + class="h-8 w-8 mr-3 bg-gray-800 hover:bg-gray-600 rounded-full disabled:bg-charcoal-700" disabled="{visibleCards.length === cards.length}"> @@ -64,7 +64,7 @@ function rotateRight() { id="right" on:click="{rotateRight}" aria-label="Rotate right" - class="h-8 w-8 ml-3 bg-gray-800 rounded-full disabled:bg-charcoal-700" + class="h-8 w-8 ml-3 bg-gray-800 hover:bg-gray-600 rounded-full disabled:bg-charcoal-700" disabled="{visibleCards.length === cards.length}">