@brightlayer-ui/react-native-auth-workflow
Version:
Re-usable workflow components for Authentication and Registration within Eaton applications.
23 lines (22 loc) • 1.04 kB
JavaScript
import React from 'react';
import { cleanup, render, screen } from '@testing-library/react-native';
import { AccountDetailsScreenBase } from '../../screens/AccountDetailsScreen';
import { Provider as PaperProvider } from 'react-native-paper';
describe('AccountDetailsScreenBase Tests', () => {
const renderer = (props) => render(React.createElement(PaperProvider, null,
React.createElement(AccountDetailsScreenBase, Object.assign({}, props))));
afterEach(cleanup);
it('renders without crashing', () => {
renderer();
});
it('should display the initial values', () => {
renderer({
firstNameLabel: 'First Name',
lastNameLabel: 'Last Name',
initialFirstName: 'Test First Name',
initialLastName: 'Test Last Name',
});
expect(screen.getByTestId('blui-account-details-first-name')).toHaveDisplayValue('Test First Name');
expect(screen.getByTestId('blui-account-details-last-name')).toHaveDisplayValue('Test Last Name');
});
});