diff --git a/examples/basic/__tests__/App.test.tsx b/examples/basic/__tests__/App.test.tsx index ba4df1cc4..7e09d5a3b 100644 --- a/examples/basic/__tests__/App.test.tsx +++ b/examples/basic/__tests__/App.test.tsx @@ -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' })); diff --git a/examples/basic/package.json b/examples/basic/package.json index ac183b522..9ce549819 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -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",