mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
chore: apply UserEvent clear to examples/basic (#1451)
This commit is contained in:
committed by
GitHub
parent
ee74d84d66
commit
a529a2da27
@@ -1,10 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
render,
|
||||
screen,
|
||||
fireEvent,
|
||||
userEvent,
|
||||
} from '@testing-library/react-native';
|
||||
import { render, screen, userEvent } from '@testing-library/react-native';
|
||||
import App from '../App';
|
||||
|
||||
jest.useFakeTimers();
|
||||
@@ -122,8 +117,8 @@ test('User can sign in after incorrect attempt', async () => {
|
||||
'Incorrect username or password'
|
||||
);
|
||||
|
||||
// Workaround for clearing TextInput, clear() function will be added soon.
|
||||
fireEvent.changeText(passwordInput, '');
|
||||
// Clear password field
|
||||
await user.clear(passwordInput);
|
||||
|
||||
await user.type(passwordInput, 'admin1');
|
||||
await user.press(screen.getByRole('button', { name: 'Sign In' }));
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@testing-library/jest-native": "^5.4.2",
|
||||
"@testing-library/react-native": "^12.2.0",
|
||||
"@testing-library/react-native": "^12.2.1",
|
||||
"@types/react": "~18.2.14",
|
||||
"jest": "^29.3.0",
|
||||
"react-test-renderer": "18.2.0",
|
||||
|
||||
Reference in New Issue
Block a user