aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/site-header.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-09 16:31:00 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commit891441a76173c708c6604fa203b175aefa222333 (patch)
tree27295311bb01a4e44dcc4f68422975cd705a24b8 /src/components/organisms/layout/site-header.test.tsx
parentf11a906420975e833f278a08470d8f9783c76f73 (diff)
refactor(components): rewrite Branding component
The component should only be responsible of the layout for the logo, the name and the optional baseline. Also, the homepage url could be different from `/` so the consumer should give the right url.
Diffstat (limited to 'src/components/organisms/layout/site-header.test.tsx')
-rw-r--r--src/components/organisms/layout/site-header.test.tsx22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/components/organisms/layout/site-header.test.tsx b/src/components/organisms/layout/site-header.test.tsx
index dc0e00d..fa1b7be 100644
--- a/src/components/organisms/layout/site-header.test.tsx
+++ b/src/components/organisms/layout/site-header.test.tsx
@@ -1,7 +1,6 @@
import { describe, expect, it } from '@jest/globals';
import NextImage from 'next/image';
import { render, screen as rtlScreen } from '../../../../tests/utils';
-import { Logo } from '../../atoms';
import { SiteHeader } from './site-header';
const nav = [
@@ -18,20 +17,18 @@ describe('SiteHeader', () => {
render(
<SiteHeader
ackeeStorageKey="ackee-tracking"
- isHome={true}
- logo={<Logo />}
- motionStorageKey="reduced-motion"
- nav={nav}
- photo={
+ logo={
<NextImage
- alt="A photo"
+ alt="A logo"
height={200}
src="https://picsum.photos/200"
width={200}
/>
}
+ motionStorageKey="reduced-motion"
+ name={<h1>{title}</h1>}
+ nav={nav}
searchPage="#"
- title={title}
/>
);
expect(
@@ -43,10 +40,7 @@ describe('SiteHeader', () => {
render(
<SiteHeader
ackeeStorageKey="ackee-tracking"
- logo={<Logo />}
- motionStorageKey="reduced-motion"
- nav={nav}
- photo={
+ logo={
<NextImage
alt="A photo"
height={200}
@@ -54,8 +48,10 @@ describe('SiteHeader', () => {
width={200}
/>
}
+ motionStorageKey="reduced-motion"
+ name={<div>{title}</div>}
+ nav={nav}
searchPage="#"
- title={title}
/>
);
expect(rtlScreen.getByRole('navigation')).toBeInTheDocument();