-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jest 16 support to fixed documented bug testing-library/user-even…
- Loading branch information
Showing
4 changed files
with
358 additions
and
23 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
12 changes: 9 additions & 3 deletions
12
src/features/book/components/book-form/__test__/book-form.test.js
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,13 +1,19 @@ | ||
import React from 'react' | ||
import { render, screen } from '../../../../_global/test-utils' | ||
import userEvent from '@testing-library/user-event' | ||
import BookForm from '../book-form.component' | ||
|
||
describe('BookForm', () => { | ||
it('should render BookForm', async () => { | ||
render( | ||
const { debug } = render( | ||
<BookForm /> | ||
) | ||
const inputElement = screen.getByPlaceholderText('name'); | ||
expect(inputElement).toBeInTheDocument() | ||
const nameInput = screen.getByTestId('form-name') | ||
expect(nameInput).toBeInTheDocument() | ||
|
||
userEvent.type(nameInput, "Shred Flanders") | ||
|
||
expect(nameInput).toHaveValue("Shred Flanders") | ||
|
||
}) | ||
}) |
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
Oops, something went wrong.