Skip to content

Commit

Permalink
chore: apply UserEvent clear to examples/basic (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjastrzebski authored Aug 14, 2023
1 parent ee74d84 commit a529a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions examples/basic/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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' }));
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a529a2d

Please sign in to comment.