Skip to content

Commit

Permalink
environment-agency-austria#107 test case with value
Browse files Browse the repository at this point in the history
  • Loading branch information
j3ernhard committed Mar 31, 2020
1 parent ea2b0b5 commit 7beda69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Select/Select/Select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IFieldComponentFieldProps, IFieldComponentMeta } from 'react-ocean-form
import { SelectBase as ReactSelect } from 'react-select';

import { createMockField, createMockFieldMeta } from '../../../test-utils/enzymeFormContext';
import { ISelectOptions, SelectBase } from '../SelectBase';
import { ISelectOptions, SelectBase, IPreparedSelectProps } from '../SelectBase';
import { BaseSelect } from './Select';
import { ISelectProps } from './Select.types';

Expand Down Expand Up @@ -83,13 +83,13 @@ describe('<Select />', () => {
expect(result.find(ReactSelect).exists()).toBeTruthy();
});

it('should render a react-select without value', () => {
const { wrapper } = setup({ fieldOverrides: {value: undefined}});
it('should render a react-select with value', () => {
const { wrapper } = setup();

type SelectInstance = { renderSelect(): JSX.Element };
type SelectInstance = { renderSelect(preparedProps: IPreparedSelectProps): JSX.Element };
const i = ((wrapper.instance()) as unknown) as SelectInstance;

const result = shallow(i.renderSelect());
const result = shallow(i.renderSelect( { value: { label: 'Test', value: 'test'}}));
expect(result.find(ReactSelect).exists()).toBeTruthy();
})
});

0 comments on commit 7beda69

Please sign in to comment.