Commit aae5793e by Sarah Fischmann

setup ability to write tests and wrote the first test

parent 9123797f
import React from 'react';
import {shallow, mount} 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" />
);
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);
});
......@@ -16,10 +16,13 @@
"test-storybook": "storyshots"
},
"dependencies": {
"babel-jest": "^20.0.3",
"babel-preset-es2015": "^6.24.1",
"classnames": "^2.2.5",
"prop-types": "^15.5.8",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.6.1",
"react-transition-group": "^1.1.2",
"reactstrap": "^4.6.2"
},
......@@ -33,6 +36,7 @@
"babel-preset-babili": "^0.0.12",
"babel-preset-env": "^1.4.0",
"babel-preset-react": "^6.24.1",
"enzyme": "^2.8.2",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-config-edx": "^2.0.1",
......
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