How to testing TextInput keyboardType="numeric"
tuantvk opened this issue · 0 comments
tuantvk commented
In Login.js
i use text.replace(/[^0-9]/g, '')
get number from text set to phone number.
and test changeText phone:
it('change text is string to phone input ', () => {
const { getByTestId } = render(<Login />);
fireEvent.changeText(getByTestId('phone'), 'isstring');
expect(getByTestId('phone').props.value).toEqual('');
});
How to improve it use jest or lib other ?