From 76ac7ccc628140c4e0e0ee5525b6c376dc7b44e9 Mon Sep 17 00:00:00 2001
From: m-tartari <37861893+m-tartari@users.noreply.github.com>
Date: Sat, 17 Feb 2024 14:40:09 +0100
Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(atoms):=20add=20`Award`=20unit?=
=?UTF-8?q?=20tests?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/atoms/Award/Award.test.tsx | 44 +++++++++++++++++++++++
1 file changed, 44 insertions(+)
create mode 100644 src/components/atoms/Award/Award.test.tsx
diff --git a/src/components/atoms/Award/Award.test.tsx b/src/components/atoms/Award/Award.test.tsx
new file mode 100644
index 0000000..6e39e40
--- /dev/null
+++ b/src/components/atoms/Award/Award.test.tsx
@@ -0,0 +1,44 @@
+import { render, screen } from '@testing-library/react'
+import { Box } from '@mui/material'
+
+import Award from './Award'
+
+describe('Award component', () => {
+ const mockProps = {
+ year: '2022',
+ title: 'Test Award',
+ organization: 'Test Organization',
+ location: 'Test Location',
+ titleProps: { color: 'text.primary' },
+ sx: { color: 'text.secondary' },
+ }
+
+ it('renders without crashing', () => {
+ render()
+ })
+
+ it('displays the correct year', () => {
+ render()
+ expect(screen.getByText(mockProps.year)).toBeInTheDocument()
+ })
+
+ it('displays the correct title', () => {
+ render()
+ expect(screen.getByText(mockProps.title)).toBeInTheDocument()
+ })
+
+ it('displays the correct organization', () => {
+ render()
+ expect(screen.getByText(mockProps.organization)).toBeInTheDocument()
+ })
+
+ it('displays the correct location', () => {
+ render()
+ expect(screen.getByText(mockProps.location)).toBeInTheDocument()
+ })
+
+ it('renders with the correct component', () => {
+ const { container } = render()
+ expect(container.firstChild!.nodeName).toBe('DIV')
+ })
+})