chore: apply UserEvent clear to examples/basic (#1451)

This commit is contained in:
Maciej Jastrzebski
2023-08-14 13:16:29 +02:00
committed by GitHub
parent ee74d84d66
commit a529a2da27
2 changed files with 4 additions and 9 deletions
+3 -8
View File
@@ -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' }));
+1 -1
View File
@@ -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",