Commit 141d0a25 by Sarah Fischmann

setup ability to write tests and wrote the first test

parent aae5793e
import React from 'react';
import {shallow, mount} from 'enzyme';
import { shallow } from 'enzyme';
import CheckBox from '../src/CheckBox';
test('aria-label changes after click', () => {
const wrapper = shallow(
<CheckBox name="checkbox" descibedBy="checkbox"
label="check me out!" checked="false" />
);
describe('<CheckBox />', () => {
it('aria-label changes after click', () => {
const wrapper = shallow(
<CheckBox
name="checkbox"
descibedBy="checkbox"
label="check me out!"
checked="false"
/>,
);
expect(wrapper.find('[aria-checked=false]').exists()).toEqual(true);
wrapper.find('input').simulate('click');
expect(wrapper.find('[aria-checked=false]').exists()).toEqual(false);
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