mirror of https://github.com/facebook/jest.git
19 lines
570 B
JavaScript
19 lines
570 B
JavaScript
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
import Enzyme, {shallow} from 'enzyme';
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
import CheckboxWithLabel from '../CheckboxWithLabel';
|
|
|
|
Enzyme.configure({adapter: new Adapter()});
|
|
|
|
it('CheckboxWithLabel changes the text after click', () => {
|
|
// Render a checkbox with label in the document
|
|
const checkbox = shallow(<CheckboxWithLabel labelOn="On" labelOff="Off" />);
|
|
|
|
expect(checkbox.text()).toEqual('Off');
|
|
|
|
checkbox.find('input').simulate('change');
|
|
|
|
expect(checkbox.text()).toEqual('On');
|
|
});
|