generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e624a0
commit 0193ccd
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(<Button>Hello!</Button>) | ||
|
||
expect(screen.getByText(/Hello!/i)).toBeInTheDocument(); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 (<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={< Nav openNav={true} onToggleNav={() => {}} />}></Route> | ||
</Routes> | ||
</BrowserRouter>) | ||
expect(screen.getByText(/Leaderboard/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Settings/i)).toBeInTheDocument(); | ||
expect(screen.getByText(/Play/i)).toBeInTheDocument(); | ||
}) | ||
}) |