aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/card/card.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/card/card.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/card/card.test.tsx')
-rw-r--r--src/components/molecules/card/card.test.tsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/molecules/card/card.test.tsx b/src/components/molecules/card/card.test.tsx
index 40a5830..769185b 100644
--- a/src/components/molecules/card/card.test.tsx
+++ b/src/components/molecules/card/card.test.tsx
@@ -1,6 +1,7 @@
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import NextImage from 'next/image';
+import { MetaItem } from '../meta-list';
import { Card } from './card';
import { CardFooter } from './card-footer';
import { CardHeader } from './card-header';
@@ -66,7 +67,11 @@ describe('Card', () => {
render(
<Card
- meta={<CardMeta items={[{ id: 'any', label: term, value: desc }]} />}
+ meta={
+ <CardMeta>
+ <MetaItem label={term} value={desc} />
+ </CardMeta>
+ }
>
<CardFooter />
</Card>
@@ -83,7 +88,11 @@ describe('Card', () => {
render(
<Card
- meta={<CardMeta items={[{ id: 'any', label: term, value: desc }]} />}
+ meta={
+ <CardMeta>
+ <MetaItem label={term} value={desc} />
+ </CardMeta>
+ }
>
{body}
</Card>