diff --git a/components/LogoNav/LogoNav.test.tsx b/components/LogoNav/LogoNav.test.tsx new file mode 100644 index 00000000..b275ddcf --- /dev/null +++ b/components/LogoNav/LogoNav.test.tsx @@ -0,0 +1,14 @@ +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.getByTestId('logo-nav'); + expect(logoImage).toBeInTheDocument(); + + 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 3182bbdb..38cef318 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,15 @@ import logo from '/public/assets/logo-colored-nav.svg'; */ export const LogoNav = (): JSX.Element => { return ( - Gridiron Survivor logo + + Gridiron Survivor logo + ); };