From a3a4c50f26b8750ae1c87f1f1103b84b7d2e6315 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 14 Nov 2023 15:11:22 +0100
Subject: refactor(components): replace LinksListWidget with LinksWidget

* avoid List component repeat
* rewrite tests and CSS
* add an id to LinksWidgetItemData (previously LinksListItems) type
because the label could be duplicated
---
 .../organisms/widgets/links-list-widget.test.tsx   | 56 ----------------------
 1 file changed, 56 deletions(-)
 delete mode 100644 src/components/organisms/widgets/links-list-widget.test.tsx

(limited to 'src/components/organisms/widgets/links-list-widget.test.tsx')

diff --git a/src/components/organisms/widgets/links-list-widget.test.tsx b/src/components/organisms/widgets/links-list-widget.test.tsx
deleted file mode 100644
index 2a914e7..0000000
--- a/src/components/organisms/widgets/links-list-widget.test.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { describe, expect, it } from '@jest/globals';
-import { render, screen as rtlScreen } from '@testing-library/react';
-import { Heading } from '../../atoms';
-import { LinksListWidget } from './links-list-widget';
-
-const title = 'Voluptatem minus autem';
-
-const items = [
-  { name: 'Item 1', url: '/item-1' },
-  { name: 'Item 2', url: '/item-2' },
-  { name: 'Item 3', url: '/item-3' },
-];
-
-describe('LinksListWidget', () => {
-  it('renders a widget title', () => {
-    render(
-      <LinksListWidget
-        heading={<Heading level={3}>{title}</Heading>}
-        items={items}
-      />
-    );
-    expect(
-      rtlScreen.getByRole('heading', { level: 3, name: new RegExp(title, 'i') })
-    ).toBeInTheDocument();
-  });
-
-  it('renders the correct number of items', () => {
-    render(
-      <LinksListWidget
-        heading={
-          <Heading isFake level={3}>
-            {title}
-          </Heading>
-        }
-        items={items}
-      />
-    );
-    expect(rtlScreen.getAllByRole('listitem')).toHaveLength(items.length);
-  });
-
-  it('renders some links', () => {
-    render(
-      <LinksListWidget
-        heading={
-          <Heading isFake level={3}>
-            {title}
-          </Heading>
-        }
-        items={items}
-      />
-    );
-    expect(
-      rtlScreen.getByRole('link', { name: items[0].name })
-    ).toHaveAttribute('href', items[0].url);
-  });
-});
-- 
cgit v1.2.3

