Skip to content

Commit

Permalink
fix: 522 - img tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KristiBo committed Sep 30, 2024
1 parent fe8fe0a commit 9e8d6f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/widgets/community-media/ui/community-media.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let communityMedia: HTMLElement;
let title: HTMLElement;
let paragraph: HTMLElement;
let socialMediaItems: HTMLElement[];
let imgElement: HTMLElement;
let slothImage: HTMLElement;

describe('CommunityMedia component', () => {
Expand All @@ -20,7 +19,6 @@ describe('CommunityMedia component', () => {
paragraph = screen.getByTestId('paragraph');
socialMediaItems = screen.getAllByTestId('social-media');
slothImage = screen.getByTestId('welcome-sloth');
imgElement = screen.getByAltText('A sloth mascot with a welcome');
});

it('renders the component without crashing', () => {
Expand All @@ -37,7 +35,7 @@ describe('CommunityMedia component', () => {
expect(title).toHaveTextContent('Join RS Community');
expect(paragraph).toHaveTextContent(/If you want to learn coding or be a RS School mentor/i);

expect(imgElement).toHaveAttribute('src', image);
expect(imgElement).toHaveAttribute('alt', 'A sloth mascot with a welcome');
expect(slothImage).toHaveAttribute('src', image);
expect(slothImage).toHaveAttribute('alt', 'A sloth mascot with a welcome');
});
});

0 comments on commit 9e8d6f6

Please sign in to comment.