1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00
awx/__tests__/components/SelectableCard.test.jsx

28 lines
684 B
React
Raw Normal View History

2019-03-28 00:27:27 +03:00
import React from 'react';
2019-04-23 00:15:32 +03:00
import { shallow } from 'enzyme';
2019-03-28 00:27:27 +03:00
import SelectableCard from '../../src/components/AddRole/SelectableCard';
describe('<SelectableCard />', () => {
let wrapper;
const onClick = jest.fn();
test('initially renders without crashing when not selected', () => {
2019-04-23 00:15:32 +03:00
wrapper = shallow(
2019-03-28 00:27:27 +03:00
<SelectableCard
onClick={onClick}
/>
);
expect(wrapper.length).toBe(1);
wrapper.unmount();
});
test('initially renders without crashing when selected', () => {
2019-04-23 00:15:32 +03:00
wrapper = shallow(
2019-03-28 00:27:27 +03:00
<SelectableCard
isSelected
onClick={onClick}
/>
);
expect(wrapper.length).toBe(1);
wrapper.unmount();
});
});