aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/layout/layout.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-20 12:27:46 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-20 19:32:09 +0100
commit70b4f633a6fbedb58c8b9134ac64ede854d489de (patch)
treec757bb12ad9a588e23b25cdb8b46710ac14dbcb1 /src/components/templates/layout/layout.test.tsx
parent9a481f066e1427d53a06cf7aeec525a745abf03f (diff)
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`
Diffstat (limited to 'src/components/templates/layout/layout.test.tsx')
-rw-r--r--src/components/templates/layout/layout.test.tsx14
1 files changed, 7 insertions, 7 deletions
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(<Layout>{body}</Layout>);
- expect(screen.getByRole('banner')).toBeInTheDocument();
+ expect(rtlScreen.getByRole('banner')).toBeInTheDocument();
});
it('renders the website main content', () => {
render(<Layout>{body}</Layout>);
- expect(screen.getByRole('main')).toBeInTheDocument();
+ expect(rtlScreen.getByRole('main')).toBeInTheDocument();
});
it('renders the website footer', () => {
render(<Layout>{body}</Layout>);
- expect(screen.getByRole('contentinfo')).toBeInTheDocument();
+ expect(rtlScreen.getByRole('contentinfo')).toBeInTheDocument();
});
it('renders a skip to content link', () => {
render(<Layout>{body}</Layout>);
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(<Layout>{body}</Layout>);
- expect(screen.getByRole('article')).toHaveTextContent(body);
+ expect(rtlScreen.getByText(body)).toBeInTheDocument();
});
});