blob: 54092629a400d5eaa57c8adae2e18b753865b568 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import NextImage from 'next/image';
import { FlippingLogo } from './flipping-logo';
describe('FlippingLogo', () => {
it('renders both sides of the logo', () => {
const frontAltTxt = 'aliquam officia et';
const backAltTxt = 'voluptas nesciunt itaque';
render(
<FlippingLogo
back={
<NextImage
alt={backAltTxt}
height={100}
src="https://picsum.photos/100"
width={100}
/>
}
front={
<NextImage
alt={frontAltTxt}
height={100}
src="https://picsum.photos/100"
width={100}
/>
}
/>
);
expect(
rtlScreen.getByRole('img', { name: frontAltTxt })
).toBeInTheDocument();
expect(
rtlScreen.getByRole('img', { name: backAltTxt })
).toBeInTheDocument();
});
});
|