Skip to content

Commit

Permalink
organizes exports/imports, adjusts refs, minor fixes/adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Feb 18, 2020
1 parent 32731ac commit 7327b28
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 185 deletions.
22 changes: 11 additions & 11 deletions src/components/combo_box/combo_box.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';
import { shallow, render, mount } from 'enzyme';
import sinon from 'sinon';
import {
Expand All @@ -11,7 +11,7 @@ import { comboBoxKeyCodes } from '../../services';
import { EuiComboBox } from './combo_box';

jest.mock('../portal', () => ({
EuiPortal: ({ children }) => children,
EuiPortal: ({ children }: { children: ReactNode }) => children,
}));

// Mock the htmlIdGenerator to generate predictable ids for snapshot tests
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('EuiComboBox', () => {
describe('props', () => {
test('options list is rendered', () => {
const component = mount(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
data-test-subj="alsoGetsAppliedToOptionsList"
/>
Expand All @@ -83,7 +83,7 @@ describe('props', () => {

test('selectedOptions are rendered', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2], options[4]]}
/>
Expand All @@ -95,15 +95,15 @@ describe('props', () => {
describe('isClearable=false disallows user from clearing input', () => {
test('when no options are selected', () => {
const component = shallow(
<EuiComboBox<TitanOption> options={options} isClearable={false} />
<EuiComboBox options={options} isClearable={false} />
);

expect(component).toMatchSnapshot();
});

test('when options are selected', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2], options[4]]}
isClearable={false}
Expand All @@ -117,7 +117,7 @@ describe('props', () => {
describe('singleSelection', () => {
test('is rendered', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2]]}
singleSelection={true}
Expand All @@ -128,7 +128,7 @@ describe('props', () => {
});
test('selects existing option when opened', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2]]}
singleSelection={true}
Expand All @@ -142,7 +142,7 @@ describe('props', () => {

test('isDisabled is rendered', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2]]}
isDisabled={true}
Expand All @@ -154,7 +154,7 @@ describe('props', () => {

test('full width is rendered', () => {
const component = shallow(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2]]}
fullWidth={true}
Expand All @@ -171,7 +171,7 @@ describe('behavior', () => {
const onCreateOptionHandler = sinon.spy();

const component = mount(
<EuiComboBox<TitanOption>
<EuiComboBox
options={options}
selectedOptions={[options[2]]}
onCreateOption={onCreateOptionHandler}
Expand Down
Loading

0 comments on commit 7327b28

Please sign in to comment.