From 70b4f633a6fbedb58c8b9134ac64ede854d489de Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 12:27:46 +0100 Subject: refactor(components): replace PageLayout template with Page * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome` --- src/components/templates/layout/layout.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/components/templates/layout/layout.test.tsx') diff --git a/src/components/templates/layout/layout.test.tsx b/src/components/templates/layout/layout.test.tsx index 6a257f0..d3abe1d 100644 --- a/src/components/templates/layout/layout.test.tsx +++ b/src/components/templates/layout/layout.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from '@jest/globals'; -import { render, screen } from '../../../../tests/utils'; +import { render, screen as rtlScreen } from '../../../../tests/utils'; import { Layout } from './layout'; const body = @@ -8,28 +8,28 @@ const body = describe('Layout', () => { it('renders the website header', () => { render({body}); - expect(screen.getByRole('banner')).toBeInTheDocument(); + expect(rtlScreen.getByRole('banner')).toBeInTheDocument(); }); it('renders the website main content', () => { render({body}); - expect(screen.getByRole('main')).toBeInTheDocument(); + expect(rtlScreen.getByRole('main')).toBeInTheDocument(); }); it('renders the website footer', () => { render({body}); - expect(screen.getByRole('contentinfo')).toBeInTheDocument(); + expect(rtlScreen.getByRole('contentinfo')).toBeInTheDocument(); }); it('renders a skip to content link', () => { render({body}); expect( - screen.getByRole('link', { name: 'Skip to content' }) + rtlScreen.getByRole('link', { name: 'Skip to content' }) ).toBeInTheDocument(); }); - it('renders an article', () => { + it('renders its body', () => { render({body}); - expect(screen.getByRole('article')).toHaveTextContent(body); + expect(rtlScreen.getByText(body)).toBeInTheDocument(); }); }); -- cgit v1.2.3