add unit test coverage for AnsibleSelect.jsx

This commit is contained in:
Jake McDermott 2019-01-07 07:21:50 -05:00
parent bbd94fa4f7
commit 48e1fbfb38
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7

View File

@ -29,4 +29,16 @@ describe('<AnsibleSelect />', () => {
wrapper.find('select').simulate('change');
expect(spy).toHaveBeenCalled();
});
});
test('content not rendered when data property is falsey', () => {
const wrapper = mount(
<AnsibleSelect
selected="foo"
selectChange={() => { }}
labelName={label}
data={null}
/>
);
expect(wrapper.find('FormGroup')).toHaveLength(0);
expect(wrapper.find('Select')).toHaveLength(0);
});
});