Fix linter errors and add test to AnsibleSelect component.

This commit is contained in:
kialam
2019-02-12 09:42:41 -05:00
parent 97477b789a
commit 2b18cee9c0
3 changed files with 15 additions and 4 deletions

View File

@@ -41,4 +41,16 @@ describe('<AnsibleSelect />', () => {
expect(wrapper.find('FormGroup')).toHaveLength(0);
expect(wrapper.find('Select')).toHaveLength(0);
});
test('Returns correct select options if defaultSelected props is passed', () => {
const wrapper = mount(
<AnsibleSelect
selected="foo"
selectChange={() => { }}
labelName={label}
data={mockData}
defaultSelected={mockData[1]}
/>
);
expect(wrapper.find('Select')).toHaveLength(1);
});
});