fleet/frontend/components/forms/fields/ShadowBoxInput/ShadowBoxInput.tests.jsx
Mike Stone e2a5502e21 Select targets (#340)
* Api client get targets

* Allow entities to parse full api response

* responsive nav style fixes

* Add disabled prop to button

* Add targets from API to target select input

* customize target rendering in input field

* call API on select target input change

* display # hosts selected

* Adds new icons to icon font

* Customize select targets input options

* Update directory structure

* restructure select targets input

* Adds hosts to labels

* Host modal styles

* ShadowBoxInput component

* TargetInfoModal for labels

* consistent entity response in api client stubs

* Fix bug removing multiple hosts in target select input

* change Button component to use css classes
2016-10-27 12:14:30 -04:00

31 lines
779 B
JavaScript

import React from 'react';
import expect from 'expect';
import { mount } from 'enzyme';
import ShadowBoxInput from './ShadowBoxInput';
describe('ShadowBoxInput - component', () => {
it('renders an input field', () => {
const component = mount(
<ShadowBoxInput name="my-input" />
);
expect(component.find('input').length).toEqual(1);
});
it('does not render an icon without an icon class', () => {
const component = mount(
<ShadowBoxInput name="my-input" />
);
expect(component.find('i').length).toEqual(0);
});
it('renders an icon with an icon class', () => {
const component = mount(
<ShadowBoxInput name="my-input" iconClass="kolidecon-label" />
);
expect(component.find('i').length).toEqual(1);
});
});