mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 10:57:36 -02:30
add unit test coverage for AnsibleSelect.jsx
This commit is contained in:
@@ -29,4 +29,16 @@ describe('<AnsibleSelect />', () => {
|
|||||||
wrapper.find('select').simulate('change');
|
wrapper.find('select').simulate('change');
|
||||||
expect(spy).toHaveBeenCalled();
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user