From 891441a76173c708c6604fa203b175aefa222333 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 9 Oct 2023 16:31:00 +0200 Subject: 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. --- src/components/molecules/layout/branding.test.tsx | 109 ---------------------- 1 file changed, 109 deletions(-) delete mode 100644 src/components/molecules/layout/branding.test.tsx (limited to 'src/components/molecules/layout/branding.test.tsx') diff --git a/src/components/molecules/layout/branding.test.tsx b/src/components/molecules/layout/branding.test.tsx deleted file mode 100644 index cfb55c5..0000000 --- a/src/components/molecules/layout/branding.test.tsx +++ /dev/null @@ -1,109 +0,0 @@ -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 { Branding } from './branding'; - -describe('Branding', () => { - it('renders a photo', () => { - const altText = 'A photo example'; - - render( - } - photo={ - - } - title="Website title" - /> - ); - expect(rtlScreen.getByRole('img', { name: altText })).toBeInTheDocument(); - }); - - it('renders a logo', () => { - const logoHeading = 'sed enim voluptatem'; - - render( - } - photo={ - - } - title="Website name" - /> - ); - expect(rtlScreen.getByTitle(logoHeading)).toBeInTheDocument(); - }); - - it('renders a baseline', () => { - render( - } - photo={ - - } - title="Website title" - baseline="Website baseline" - /> - ); - expect(rtlScreen.getByText('Website baseline')).toBeInTheDocument(); - }); - - it('renders a title wrapped with h1 element', () => { - render( - } - photo={ - - } - title="Website title" - isHome={true} - /> - ); - expect( - rtlScreen.getByRole('heading', { level: 1, name: 'Website title' }) - ).toBeInTheDocument(); - }); - - it('renders a title with h1 styles', () => { - render( - } - photo={ - - } - title="Website title" - isHome={false} - /> - ); - expect( - rtlScreen.queryByRole('heading', { level: 1, name: 'Website title' }) - ).not.toBeInTheDocument(); - expect(rtlScreen.getByText('Website title')).toHaveClass('heading--1'); - }); -}); -- cgit v1.2.3