From 467fb0c150f191bb311598c28fbd73c772d0e43a Mon Sep 17 00:00:00 2001 From: Mai Vang Date: Sat, 20 Jul 2024 12:39:01 -0700 Subject: [PATCH 1/5] added in Link to logo --- components/LogoNav/LogoNav.test.tsx | 16 ++++++++++++++++ components/LogoNav/LogoNav.tsx | 21 ++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 components/LogoNav/LogoNav.test.tsx diff --git a/components/LogoNav/LogoNav.test.tsx b/components/LogoNav/LogoNav.test.tsx new file mode 100644 index 00000000..31c08249 --- /dev/null +++ b/components/LogoNav/LogoNav.test.tsx @@ -0,0 +1,16 @@ +import { render, screen, fireEvent, waitFor } from '@testing-library/react'; +import LogoNav from './LogoNav'; + +describe('LogoNav Component', () => { + it('renders the logo and links to the /league/all page', () => { + render(); + + const logoImage = screen.getByAltText('Gridiron Survivor logo'); + expect(logoImage).toBeInTheDocument(); + + const linkElement = screen.getByRole('link', { + name: /Gridiron Survivor logo/i, + }); + expect(linkElement).toHaveAttribute('href', '/league/all'); + }); +}); diff --git a/components/LogoNav/LogoNav.tsx b/components/LogoNav/LogoNav.tsx index 3182bbdb..17d17a9e 100644 --- a/components/LogoNav/LogoNav.tsx +++ b/components/LogoNav/LogoNav.tsx @@ -3,6 +3,7 @@ import { JSX } from 'react'; import Image from 'next/image'; +import Link from 'next/link'; import logo from '/public/assets/logo-colored-nav.svg'; /** @@ -11,15 +12,17 @@ import logo from '/public/assets/logo-colored-nav.svg'; */ export const LogoNav = (): JSX.Element => { return ( - Gridiron Survivor logo + + Gridiron Survivor logo + ); }; From 85642ea9b2463a9d58d3827adc7068d9567c1249 Mon Sep 17 00:00:00 2001 From: Mai Vang Date: Tue, 23 Jul 2024 05:20:31 -0700 Subject: [PATCH 2/5] removed width and height of logo --- components/LogoNav/LogoNav.test.tsx | 2 +- components/LogoNav/LogoNav.tsx | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/LogoNav/LogoNav.test.tsx b/components/LogoNav/LogoNav.test.tsx index 31c08249..3adadb06 100644 --- a/components/LogoNav/LogoNav.test.tsx +++ b/components/LogoNav/LogoNav.test.tsx @@ -5,7 +5,7 @@ describe('LogoNav Component', () => { it('renders the logo and links to the /league/all page', () => { render(); - const logoImage = screen.getByAltText('Gridiron Survivor logo'); + const logoImage = screen.getByTestId('logo-nav'); expect(logoImage).toBeInTheDocument(); const linkElement = screen.getByRole('link', { diff --git a/components/LogoNav/LogoNav.tsx b/components/LogoNav/LogoNav.tsx index 17d17a9e..b60798c3 100644 --- a/components/LogoNav/LogoNav.tsx +++ b/components/LogoNav/LogoNav.tsx @@ -12,16 +12,8 @@ import logo from '/public/assets/logo-colored-nav.svg'; */ export const LogoNav = (): JSX.Element => { return ( - - Gridiron Survivor logo + + Gridiron Survivor logo ); }; From eb39712c095d6cec3902e9e0e834d7991980b6de Mon Sep 17 00:00:00 2001 From: Mai Vang Date: Tue, 23 Jul 2024 05:44:37 -0700 Subject: [PATCH 3/5] added in height and width back --- components/LogoNav/LogoNav.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/LogoNav/LogoNav.tsx b/components/LogoNav/LogoNav.tsx index b60798c3..8668659c 100644 --- a/components/LogoNav/LogoNav.tsx +++ b/components/LogoNav/LogoNav.tsx @@ -13,7 +13,13 @@ import logo from '/public/assets/logo-colored-nav.svg'; export const LogoNav = (): JSX.Element => { return ( - Gridiron Survivor logo + Gridiron Survivor logo ); }; From 8e71a9542155c570d483e2694b7dc5e9a1138405 Mon Sep 17 00:00:00 2001 From: Mai Vang Date: Thu, 25 Jul 2024 10:49:52 -0700 Subject: [PATCH 4/5] realphabetize attributes --- components/LogoNav/LogoNav.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/LogoNav/LogoNav.tsx b/components/LogoNav/LogoNav.tsx index 8668659c..d9f9e7e1 100644 --- a/components/LogoNav/LogoNav.tsx +++ b/components/LogoNav/LogoNav.tsx @@ -14,11 +14,11 @@ export const LogoNav = (): JSX.Element => { return ( Gridiron Survivor logo ); From 74f8316cb0029ab12c4cae907ee5049827faafd7 Mon Sep 17 00:00:00 2001 From: Mai Vang Date: Tue, 30 Jul 2024 04:22:14 -0700 Subject: [PATCH 5/5] updated unit test --- components/LogoNav/LogoNav.test.tsx | 6 ++---- components/LogoNav/LogoNav.tsx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/LogoNav/LogoNav.test.tsx b/components/LogoNav/LogoNav.test.tsx index 3adadb06..b275ddcf 100644 --- a/components/LogoNav/LogoNav.test.tsx +++ b/components/LogoNav/LogoNav.test.tsx @@ -8,9 +8,7 @@ describe('LogoNav Component', () => { const logoImage = screen.getByTestId('logo-nav'); expect(logoImage).toBeInTheDocument(); - const linkElement = screen.getByRole('link', { - name: /Gridiron Survivor logo/i, - }); - expect(linkElement).toHaveAttribute('href', '/league/all'); + const linkLogoNav = screen.getByTestId('link-logo-nav'); + expect(linkLogoNav).toHaveAttribute('href', '/league/all'); }); }); diff --git a/components/LogoNav/LogoNav.tsx b/components/LogoNav/LogoNav.tsx index d9f9e7e1..38cef318 100644 --- a/components/LogoNav/LogoNav.tsx +++ b/components/LogoNav/LogoNav.tsx @@ -12,7 +12,7 @@ import logo from '/public/assets/logo-colored-nav.svg'; */ export const LogoNav = (): JSX.Element => { return ( - +