From 0556447e24ca313b4337ef480f61fa1fa8dcd41c Mon Sep 17 00:00:00 2001 From: slashexx Date: Sat, 2 Nov 2024 20:42:01 +0530 Subject: [PATCH] Added frontend tests --- frontend/src/IntroPage.test.tsx | 6 +++++- frontend/src/IntroPage.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/IntroPage.test.tsx b/frontend/src/IntroPage.test.tsx index e6f6b8a..83af952 100644 --- a/frontend/src/IntroPage.test.tsx +++ b/frontend/src/IntroPage.test.tsx @@ -1,8 +1,12 @@ import { render, screen } from '@testing-library/react'; +import { BrowserRouter } from 'react-router-dom' import IntroPage from './IntroPage'; test('renders CodeBrewery title', () => { - render(); + render( + + + ); const titleElement = screen.getByText(/CodeBrewery/i); expect(titleElement).toBeInTheDocument(); }); diff --git a/frontend/src/IntroPage.tsx b/frontend/src/IntroPage.tsx index ddaee1e..13e6c98 100644 --- a/frontend/src/IntroPage.tsx +++ b/frontend/src/IntroPage.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Code2, Sparkles, Terminal, Cpu, Beer, Wine } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; -export function IntroPage() { +export default function IntroPage() { const navigate = useNavigate(); return (