From f3724950511d656d64d9ae9d1e16f09f582298c0 Mon Sep 17 00:00:00 2001
From: m-tartari <37861893+m-tartari@users.noreply.github.com>
Date: Sat, 17 Feb 2024 15:13:40 +0100
Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(atoms):=20add=20`IconLinks`=20?=
=?UTF-8?q?unit=20tests?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../atoms/IconLinks/IconLinks.test.tsx | 49 +++++++++++++++++++
src/components/atoms/IconLinks/IconLinks.tsx | 2 +-
2 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 src/components/atoms/IconLinks/IconLinks.test.tsx
diff --git a/src/components/atoms/IconLinks/IconLinks.test.tsx b/src/components/atoms/IconLinks/IconLinks.test.tsx
new file mode 100644
index 0000000..957699d
--- /dev/null
+++ b/src/components/atoms/IconLinks/IconLinks.test.tsx
@@ -0,0 +1,49 @@
+// IconLinks.test.tsx
+
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+
+import * as IconLinks from '.'
+
+const labels: { [key: string]: string } = {
+ DescriptionIconLink: 'Doc-button',
+ EmailIconLink: 'Email-button',
+ GitHubIconLink: 'GitHub-button',
+ LinkedInIconLink: 'LinkedIn-button',
+ AcademyIconLink: 'Academy-button',
+ VideoIconLink: 'Video-button',
+ ExtrernalIconLink: 'External-link-button',
+}
+describe('IconLinks', () => {
+ const open = vi.spyOn(window, 'open')
+
+ const defaultProps = {
+ href: 'https://test.com',
+ fontSize: 'large' as const,
+ }
+
+ describe.each(Object.entries(IconLinks))('%s', (name, Icon) => {
+ test('renders correctly and without crashing', async () => {
+ render(