mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-26 07:49:18 +00:00
committed by
Nicolas Gallagher
parent
5dd414f9aa
commit
22eebea633
@@ -24,14 +24,14 @@ describe('components/Switch', () => {
|
||||
const onValueChange = jest.fn();
|
||||
const component = shallow(<Switch onValueChange={onValueChange} value={false} />);
|
||||
component.find('input').simulate('change', { nativeEvent: { target: { checked: true } } });
|
||||
expect(onValueChange).toHaveBeenCalledWith(true)
|
||||
expect(onValueChange).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
test('when value is "true" it receives "false"', () => {
|
||||
const onValueChange = jest.fn();
|
||||
const component = shallow(<Switch onValueChange={onValueChange} value />);
|
||||
component.find('input').simulate('change', { nativeEvent: { target: { checked: false } } });
|
||||
expect(onValueChange).toHaveBeenCalledWith(false)
|
||||
expect(onValueChange).toHaveBeenCalledWith(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user