Skip to content

Commit

Permalink
feat: add unit test for test img alt
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuuriii committed Nov 16, 2023
1 parent 90d4e02 commit c3b9c70
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/components/features/feature.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ describe('test text and img alt', () => {
expect(secondDescItem).toBeInTheDocument();
expect(thirdDescItem).toBeInTheDocument();
});
test('test img alt', () => {
render(<Features />);
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();
});
});
3 changes: 3 additions & 0 deletions app/components/features/featureData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
];
4 changes: 2 additions & 2 deletions app/components/features/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Features() {
<Image
className='lg:h-[16rem] xl:h-[20rem] w-auto lg:mr-[3rem]'
src={Meetings}
alt=''
alt='meetings-icon'
/>
<div className='mt-[4.4rem] lg:mt-[0rem]'>
<h2
Expand All @@ -47,7 +47,7 @@ export default function Features() {
<Image
className='h-[1.8rem] w-[1.8rem] lg:h-[1.4rem] lg:w-[1.4rem]'
src={item.icon}
alt=''
alt={item.alt}
/>
</div>
<p
Expand Down

0 comments on commit c3b9c70

Please sign in to comment.