import React, { useState } from 'react';
import { fireEvent, render } from 'react-native-testing-library';
import renderer from 'react-test-renderer';
import { ThemeProvider } from 'styled-components/native';
import { theme } from '../../../test/helpers';
import PasswordInput from '../PasswordInput';
describe('<PasswordInput />', () => {
    it('should render PasswordInput', () => {
        const wrapper = renderer.create(<ThemeProvider theme={theme}>
        <PasswordInput inputRef="$text" id="test" accessibility="test"/>
      </ThemeProvider>);
        expect(wrapper.toJSON()).toMatchSnapshot();
    });
    it('should render input and trigger state change, blur, focus and onPressIcon', () => {
        const onBlurFN = jest.fn();
        const onFocusFN = jest.fn();
        const Component = () => {
            const [value, setValue] = useState('');
            return (<ThemeProvider theme={theme}>
          <PasswordInput id="testing_passwordInput" accessibility="" value={value} onChangeText={setValue} onBlur={onBlurFN} onFocus={onFocusFN}/>
        </ThemeProvider>);
        };
        const { getByTestId } = render(<Component />);
        const component = getByTestId('testing_passwordInput');
        fireEvent.changeText(component, 'Value changed');
        fireEvent(component, 'blur');
        fireEvent(component, 'focus');
        expect(onBlurFN).toHaveBeenCalled();
        expect(onFocusFN).toHaveBeenCalled();
        expect(component.props.value).toBe('Value changed');
    });
});
//# sourceMappingURL=PasswordInput.spec.js.map