Commit 141d0a25 by Sarah Fischmann

setup ability to write tests and wrote the first test

parent aae5793e
import React from 'react'; import React from 'react';
import {shallow, mount} from 'enzyme'; import { shallow } from 'enzyme';
import CheckBox from '../src/CheckBox'; import CheckBox from '../src/CheckBox';
test('aria-label changes after click', () => { describe('<CheckBox />', () => {
const wrapper = shallow( it('aria-label changes after click', () => {
<CheckBox name="checkbox" descibedBy="checkbox" const wrapper = shallow(
label="check me out!" checked="false" /> <CheckBox
); name="checkbox"
descibedBy="checkbox"
label="check me out!"
checked="false"
/>,
);
expect(wrapper.find('[aria-checked=false]').exists()).toEqual(true); expect(wrapper.find('[aria-checked=false]').exists()).toEqual(true);
wrapper.find('input').simulate('click'); wrapper.find('input').simulate('click');
expect(wrapper.find('[aria-checked=false]').exists()).toEqual(false); expect(wrapper.find('[aria-checked=false]').exists()).toEqual(false);
expect(wrapper.find('[aria-checked=true]').exists()).toEqual(true); expect(wrapper.find('[aria-checked=true]').exists()).toEqual(true);
});
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment