-
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.
Move tests out of pages directory (#90)
- Loading branch information
1 parent
fea8474
commit e9426f3
Showing
2 changed files
with
15 additions
and
26 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 |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
import Home from '../pages/index'; | ||
|
||
describe('Home Page', () => { | ||
it('Renders', () => { | ||
render(<Home apiUrl="https://localhost" authPassword="testPassword" />); | ||
|
||
expect(screen.getByText('Support bot')).toBeInTheDocument(); | ||
expect(screen.getByRole('heading', { name: 'Support bot' })).toBeVisible(); | ||
}); | ||
|
||
it('Shows the chatbot dialog once proper auth is entered', async () => { | ||
render(<Home apiUrl={'some-url'} authPassword={'the-right-password'} />); | ||
|
||
await userEvent.type( | ||
screen.getByLabelText('Please enter the password'), | ||
'the-right-password', | ||
); | ||
|
||
await userEvent.click(screen.getByRole('button', { name: 'Enter' })); | ||
|
||
expect(screen.getByLabelText('What is your question?')).toBeVisible(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.