Skip to content

Commit

Permalink
Fix Login test
Browse files Browse the repository at this point in the history
  • Loading branch information
UO287747 committed Feb 19, 2024
1 parent 78032f0 commit c838458
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions webapp/src/test/Login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ describe('Login component', () => {

it('should log in successfully', async () => {

const [menuState, setMenuState] = useState(0)

const goTo = (parameter) => {
setMenuState(parameter)
}

render(<Login goTo={(x) => goTo(x)} />);
render(<Login goTo={(parameter) => {}} />);

const usernameInput = screen.getByLabelText(/Username/i);
const passwordInput = screen.getByLabelText(/Password/i);
Expand All @@ -43,13 +37,7 @@ describe('Login component', () => {

it('should handle error when logging in', async () => {

const [menuState, setMenuState] = useState(0)

const goTo = (parameter) => {
setMenuState(parameter)
}

render(<Login goTo={(x) => goTo(x)} />);
render(<Login goTo={(parameter) => {}} />);

const usernameInput = screen.getByLabelText(/Username/i);
const passwordInput = screen.getByLabelText(/Password/i);
Expand Down

0 comments on commit c838458

Please sign in to comment.