summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/cards-list.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-13 19:34:49 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-13 19:34:49 +0200
commit872b0c172a38db4f440dc6044eb1d5725c03abb1 (patch)
tree712c7ad605fb21a01be0acc5faa081051955d60a /src/components/organisms/layout/cards-list.test.tsx
parent47e35fcd7c2c346f4799630bf6521d6a4bf49e85 (diff)
chore: add a CardsList component
Diffstat (limited to 'src/components/organisms/layout/cards-list.test.tsx')
-rw-r--r--src/components/organisms/layout/cards-list.test.tsx61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/components/organisms/layout/cards-list.test.tsx b/src/components/organisms/layout/cards-list.test.tsx
new file mode 100644
index 0000000..2df3f59
--- /dev/null
+++ b/src/components/organisms/layout/cards-list.test.tsx
@@ -0,0 +1,61 @@
+import { render, screen } from '@test-utils';
+import CardsList from './cards-list';
+
+const items = [
+ {
+ id: 'card-1',
+ cover: {
+ alt: 'card 1 picture',
+ src: 'http://placeimg.com/640/480',
+ width: 640,
+ height: 480,
+ },
+ meta: [
+ { id: 'meta-1', term: 'Quibusdam', value: ['Velit', 'Ex', 'Alias'] },
+ ],
+ tagline: 'Molestias ut error',
+ title: 'Et alias omnis',
+ url: '#',
+ },
+ {
+ id: 'card-2',
+ cover: {
+ alt: 'card 2 picture',
+ src: 'http://placeimg.com/640/480',
+ width: 640,
+ height: 480,
+ },
+ meta: [{ id: 'meta-1', term: 'Est', value: ['Voluptas'] }],
+ tagline: 'Quod vel accusamus',
+ title: 'Laboriosam doloremque mollitia',
+ url: '#',
+ },
+ {
+ id: 'card-3',
+ cover: {
+ alt: 'card 3 picture',
+ src: 'http://placeimg.com/640/480',
+ width: 640,
+ height: 480,
+ },
+ meta: [
+ {
+ id: 'meta-1',
+ term: 'Omnis',
+ value: ['Quisquam', 'Quia', 'Sapiente', 'Perspiciatis'],
+ },
+ ],
+ tagline: 'Quo error eum',
+ title: 'Magni rem nulla',
+ url: '#',
+ },
+];
+
+describe('CardsList', () => {
+ it('renders a list of cards', () => {
+ render(<CardsList items={items} titleLevel={2} />);
+ expect(screen.getAllByRole('heading', { level: 2 })).toHaveLength(
+ items.length
+ );
+ });
+});