2019-09-07 10:20:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { mount } from 'enzyme';
|
|
|
|
import ComboBox from '.';
|
2019-09-09 06:48:30 +00:00
|
|
|
import DropDownItem from '../drop-down-item';
|
2019-09-07 10:20:47 +00:00
|
|
|
|
|
|
|
describe('<ComboBox />', () => {
|
|
|
|
it('renders without error', () => {
|
2019-09-09 06:48:30 +00:00
|
|
|
const advancedOptions = (
|
|
|
|
<>
|
|
|
|
<DropDownItem>
|
|
|
|
<span>Some text</span>
|
|
|
|
</DropDownItem>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
2019-09-07 10:20:47 +00:00
|
|
|
const wrapper = mount(
|
|
|
|
<ComboBox
|
|
|
|
options={[]} // An empty array will enable advancedOptions
|
2019-09-09 06:48:30 +00:00
|
|
|
advancedOptions={advancedOptions}
|
2019-09-07 10:20:47 +00:00
|
|
|
onSelect={option => console.log("Selected option", option)}
|
|
|
|
selectedOption={{
|
|
|
|
key: 0,
|
|
|
|
label: "Select"
|
|
|
|
}}
|
|
|
|
isDisabled={false}
|
|
|
|
scaled={false}
|
|
|
|
size="content"
|
|
|
|
directionX="right"
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(wrapper).toExist();
|
|
|
|
});
|
|
|
|
});
|