From c3b9c704a19e9170c12c8aceab6a312d5220a8b7 Mon Sep 17 00:00:00 2001 From: Nurrohmann Date: Thu, 16 Nov 2023 16:03:25 +0700 Subject: [PATCH] feat: add unit test for test img alt --- app/components/features/feature.test.tsx | 12 ++++++++++++ app/components/features/featureData.ts | 3 +++ app/components/features/features.tsx | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/components/features/feature.test.tsx b/app/components/features/feature.test.tsx index 60979a2..1a9a166 100644 --- a/app/components/features/feature.test.tsx +++ b/app/components/features/feature.test.tsx @@ -29,4 +29,16 @@ describe('test text and img alt', () => { expect(secondDescItem).toBeInTheDocument(); expect(thirdDescItem).toBeInTheDocument(); }); + test('test img alt', () => { + render(); + const meetingsIcon = screen.getByAltText('meetings-icon'); + const gridIcon = screen.getByAltText('grid-icon'); + const squareIcon = screen.getByAltText('square-icon'); + const teamsIcon = screen.getByAltText('purple-teams-icon'); + + expect(meetingsIcon).toBeVisible(); + expect(gridIcon).toBeVisible(); + expect(squareIcon).toBeVisible(); + expect(teamsIcon).toBeVisible(); + }); }); diff --git a/app/components/features/featureData.ts b/app/components/features/featureData.ts index 09a485b..bce5c1c 100644 --- a/app/components/features/featureData.ts +++ b/app/components/features/featureData.ts @@ -5,14 +5,17 @@ import Square from '@/assets/features/square.svg'; export const featureData = [ { icon: Grid, + alt: 'grid-icon', decs: 'Teachers don’t get lost in the grid view and have a dedicated Podium space.', }, { icon: Square, + alt: 'square-icon', decs: 'TA’s and presenters can be moved to the front of the class.', }, { icon: PurpleTeams, + alt: 'purple-teams-icon', decs: 'Teachers can easily see all students and class data at one time.', }, ]; diff --git a/app/components/features/features.tsx b/app/components/features/features.tsx index 6f47c4d..412c642 100644 --- a/app/components/features/features.tsx +++ b/app/components/features/features.tsx @@ -27,7 +27,7 @@ export default function Features() {