aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/page-header.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-20 11:02:20 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-20 19:20:21 +0100
commitd5ade2359539648845a5854ed353b29367961d74 (patch)
tree45a49d90090408887135a971a7fd79c45d9dcd94 /src/components/molecules/layout/page-header.test.tsx
parent6ab9635a22d69186c8a24181ad5df7736e288577 (diff)
refactor(components): extract MetaItem from MetaList
* replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers.
Diffstat (limited to 'src/components/molecules/layout/page-header.test.tsx')
-rw-r--r--src/components/molecules/layout/page-header.test.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/molecules/layout/page-header.test.tsx b/src/components/molecules/layout/page-header.test.tsx
index 1f1a139..82aa7e1 100644
--- a/src/components/molecules/layout/page-header.test.tsx
+++ b/src/components/molecules/layout/page-header.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 { PageHeader } from './page-header';
const title = 'Non nemo amet';
@@ -9,11 +9,13 @@ const intro =
describe('PageHeader', () => {
it('renders a title', () => {
render(<PageHeader title={title} intro={intro} />);
- expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(title);
+ expect(rtlScreen.getByRole('heading', { level: 1 })).toHaveTextContent(
+ title
+ );
});
it('renders an introduction', () => {
render(<PageHeader title={title} intro={intro} />);
- expect(screen.getByText(intro)).toBeInTheDocument();
+ expect(rtlScreen.getByText(intro)).toBeInTheDocument();
});
});