diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-09 14:33:29 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | f11a906420975e833f278a08470d8f9783c76f73 (patch) | |
| tree | cd98eb0c73e07d08fbbe3006a2f7d5a34b0464b3 /src/components/molecules/images/flipping-logo/flipping-logo.test.tsx | |
| parent | d75b9a1e150ab211c1052fb49bede9bd16320aca (diff) | |
refactor(components): extract FlippingLogo from Branding component
Diffstat (limited to 'src/components/molecules/images/flipping-logo/flipping-logo.test.tsx')
| -rw-r--r-- | src/components/molecules/images/flipping-logo/flipping-logo.test.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/components/molecules/images/flipping-logo/flipping-logo.test.tsx b/src/components/molecules/images/flipping-logo/flipping-logo.test.tsx new file mode 100644 index 0000000..5409262 --- /dev/null +++ b/src/components/molecules/images/flipping-logo/flipping-logo.test.tsx @@ -0,0 +1,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(); + }); +}); |
