diff --git a/webapp/src/components/Button/Button.test.js b/webapp/src/components/Button/Button.test.js new file mode 100644 index 00000000..a7e98298 --- /dev/null +++ b/webapp/src/components/Button/Button.test.js @@ -0,0 +1,12 @@ +import React from 'react'; +import { render, fireEvent, screen, waitFor } from '@testing-library/react'; +import Button from './Button'; +import '@testing-library/jest-dom' + +describe('Button component', () => { + it ('renders without crashing', () => { + render() + + expect(screen.getByText(/Hello!/i)).toBeInTheDocument(); + }) +}) \ No newline at end of file diff --git a/webapp/src/components/Nav/Nav.test.js b/webapp/src/components/Nav/Nav.test.js new file mode 100644 index 00000000..21a35f43 --- /dev/null +++ b/webapp/src/components/Nav/Nav.test.js @@ -0,0 +1,19 @@ +import React from 'react'; +import { render, fireEvent, screen, waitFor } from '@testing-library/react'; +import Nav from './Nav'; +import '@testing-library/jest-dom' +import { Routes, BrowserRouter, Route } from 'react-router-dom' + +describe('Nav component', () => { + it ('renders Nap without crashing', () => { + + render ( + + {}} />}> + + ) + expect(screen.getByText(/Leaderboard/i)).toBeInTheDocument(); + expect(screen.getByText(/Settings/i)).toBeInTheDocument(); + expect(screen.getByText(/Play/i)).toBeInTheDocument(); + }) +}) \ No newline at end of file