aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/images/gallery.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-18 19:25:02 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commit94448fa278ab352a741ff13f22d6104869571144 (patch)
tree2185e77f2866d11a0144d4ac5a01c71a76807341 /src/components/organisms/images/gallery.test.tsx
parentc153f93dc8691a71dc76aad3dd618298da9d238a (diff)
feat(components): add a generic Grid component
* merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
Diffstat (limited to 'src/components/organisms/images/gallery.test.tsx')
-rw-r--r--src/components/organisms/images/gallery.test.tsx43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/components/organisms/images/gallery.test.tsx b/src/components/organisms/images/gallery.test.tsx
deleted file mode 100644
index bffc3b2..0000000
--- a/src/components/organisms/images/gallery.test.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { describe, expect, it } from '@jest/globals';
-import { render, screen as rtlScreen } from '@testing-library/react';
-import NextImage from 'next/image';
-import { Gallery } from './gallery';
-
-const columns = 3;
-
-const image = {
- alt: 'Modi provident omnis',
- height: 480,
- src: 'http://picsum.photos/640/480',
- width: 640,
-};
-
-describe('Gallery', () => {
- it('renders the correct number of items', () => {
- render(
- <Gallery columns={columns}>
- <NextImage {...image} />
- <NextImage {...image} />
- <NextImage {...image} />
- <NextImage {...image} />
- </Gallery>
- );
-
- // eslint-disable-next-line @typescript-eslint/no-magic-numbers
- expect(rtlScreen.getAllByRole('listitem')).toHaveLength(4);
- });
-
- it('renders the right number of columns', () => {
- render(
- <Gallery columns={columns}>
- <NextImage {...image} />
- <NextImage {...image} />
- <NextImage {...image} />
- <NextImage {...image} />
- </Gallery>
- );
- expect(rtlScreen.getByRole('list')).toHaveClass(
- `wrapper--${columns}-columns`
- );
- });
-});