diff --git a/__tests__/components/ui/PrizeCard.test.tsx b/__tests__/components/ui/PrizeCard.test.tsx index 68f93c8..9870ef8 100644 --- a/__tests__/components/ui/PrizeCard.test.tsx +++ b/__tests__/components/ui/PrizeCard.test.tsx @@ -19,7 +19,6 @@ jest.mock('next/image', () => ({ describe('PrizeCard', () => { const defaultProps = { imageSrc: '/images/lots/infuseur.png', - imageAlt: 'Infuseur à thé premium', badge: '60%', title: 'Infuseur à thé premium', description: 'Un infuseur en acier inoxydable de haute qualité', @@ -31,14 +30,14 @@ describe('PrizeCard', () => { expect(screen.getByText('Infuseur à thé premium')).toBeInTheDocument(); expect(screen.getByText('Un infuseur en acier inoxydable de haute qualité')).toBeInTheDocument(); expect(screen.getByText('60%')).toBeInTheDocument(); - expect(screen.getByAltText('Infuseur à thé premium')).toBeInTheDocument(); }); - it('should render image with correct src', () => { - render(); + it('should render image with correct src and empty alt for decorative image', () => { + const { container } = render(); - const image = screen.getByAltText('Infuseur à thé premium'); + const image = container.querySelector('img'); expect(image).toHaveAttribute('src', '/images/lots/infuseur.png'); + expect(image).toHaveAttribute('alt', ''); }); it('should render with default styling for non-grand prix', () => { @@ -72,11 +71,13 @@ describe('PrizeCard', () => { it('should have correct structure with image container and content', () => { const { container } = render(); - // Check image container exists - expect(container.querySelector('.aspect-square')).toBeInTheDocument(); + // Check image container exists with aria-hidden for decorative image + const imageContainer = container.querySelector('.aspect-square'); + expect(imageContainer).toBeInTheDocument(); + expect(imageContainer).toHaveAttribute('aria-hidden', 'true'); // Check title is h3 - const title = screen.getByText('Infuseur à thé premium'); - expect(title.tagName).toBe('H3'); + const title = screen.getByRole('heading', { level: 3 }); + expect(title).toHaveTextContent('Infuseur à thé premium'); }); }); diff --git a/app/lots/page.tsx b/app/lots/page.tsx index 119ed8a..e4621cc 100644 --- a/app/lots/page.tsx +++ b/app/lots/page.tsx @@ -9,12 +9,12 @@ export const metadata: Metadata = { }; const PRIZES = [ - { imageSrc: "/images/lots/infuseur.png", imageAlt: "Infuseur à thé premium", badge: "60% des lots", title: "Infuseur à thé premium", description: "Un infuseur en acier inoxydable de haute qualité pour ressortir les arômes de vos thés en vrac" }, - { imageSrc: "/images/lots/the-detox.png", imageAlt: "Boîte 100g thé détox", badge: "20% des lots", title: "Boîte 100g thé détox", description: "Mélange détox aux plantes bio : menthe, citronnelle, fenouil et gingembre" }, - { imageSrc: "/images/lots/the-signature.png", imageAlt: "Boîte 100g thé signature", badge: "10% des lots", title: "Boîte 100g thé signature", description: "Notre mélange signature exclusif : Earl Grey aux agrumes et pétales de fleurs" }, - { imageSrc: "/images/lots/coffret-39.png", imageAlt: "Coffret découverte 39€", badge: "6% des lots", title: "Coffret découverte 39€", description: "Sélection de nos 3 thés premium dans un élégant coffret cadeau" }, - { imageSrc: "/images/lots/coffret-69.jpg", imageAlt: "Coffret prestige 69€", badge: "4% des lots", title: "Coffret prestige 69€", description: "Collection premium : 5 thés d'exception avec accessoires dans un coffret luxe" }, - { imageSrc: "/images/lots/grand-prix.png", imageAlt: "Grand prix - 1 an de thé", badge: "1 an de THÉ", title: "Tirage Final", description: "Livraison mensuelle pendant 12 mois", isGrandPrix: true }, + { imageSrc: "/images/lots/infuseur.png", imageAlt: "", badge: "60% des lots", title: "Infuseur à thé premium", description: "Un infuseur en acier inoxydable de haute qualité pour ressortir les arômes de vos thés en vrac" }, + { imageSrc: "/images/lots/the-detox.png", imageAlt: "", badge: "20% des lots", title: "Boîte 100g thé détox", description: "Mélange détox aux plantes bio : menthe, citronnelle, fenouil et gingembre" }, + { imageSrc: "/images/lots/the-signature.png", imageAlt: "", badge: "10% des lots", title: "Boîte 100g thé signature", description: "Notre mélange signature exclusif : Earl Grey aux agrumes et pétales de fleurs" }, + { imageSrc: "/images/lots/coffret-39.png", imageAlt: "", badge: "6% des lots", title: "Coffret découverte 39€", description: "Sélection de nos 3 thés premium dans un élégant coffret cadeau" }, + { imageSrc: "/images/lots/coffret-69.jpg", imageAlt: "", badge: "4% des lots", title: "Coffret prestige 69€", description: "Collection premium : 5 thés d'exception avec accessoires dans un coffret luxe" }, + { imageSrc: "/images/lots/grand-prix.png", imageAlt: "", badge: "1 an de THÉ", title: "Tirage Final", description: "Livraison mensuelle pendant 12 mois", isGrandPrix: true }, ]; export default function LotsPage() { @@ -24,7 +24,7 @@ export default function LotsPage() {
-

+

Lots à gagner

@@ -41,11 +41,11 @@ export default function LotsPage() {

-
+