diff --git a/__tests__/components/AnsibleSelect.test.jsx b/__tests__/components/AnsibleSelect.test.jsx index 8f54b0d522..c80207cc9d 100644 --- a/__tests__/components/AnsibleSelect.test.jsx +++ b/__tests__/components/AnsibleSelect.test.jsx @@ -33,19 +33,6 @@ describe('', () => { expect(spy).toHaveBeenCalled(); }); - test('content not rendered when data property is falsey', () => { - const wrapper = mount( - { }} - label={label} - data={null} - /> - ); - 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( ', () => { @@ -157,4 +158,37 @@ describe('', () => { }); expect(createInstanceGroupsFn).toHaveBeenCalledWith('/api/v2/organizations/1/instance_groups', 1); }); + + test('AnsibleSelect component renders if there are virtual environments', () => { + const config = { + custom_virtualenvs: ['foo', 'bar'], + }; + const wrapper = mount( + + + + + + + + ).find('OrganizationAdd').find('AnsibleSelect'); + expect(wrapper.find('Select')).toHaveLength(1); + expect(wrapper.find('SelectOption')).toHaveLength(2); + }); + + test('AnsibleSelect component does not render if there are 0 virtual environments', () => { + const config = { + custom_virtualenvs: [], + }; + const wrapper = mount( + + + + + + + + ).find('OrganizationAdd').find('AnsibleSelect'); + expect(wrapper.find('Select')).toHaveLength(0); + }); });