12345678910111213141516171819202122232425262728293031323334 |
- import {mountWithTheme} from 'sentry-test/enzyme';
- import {FormState, GenericField} from 'sentry/components/deprecatedforms';
- describe('GenericField', function () {
- it('renders text as TextInput', function () {
- const wrapper = mountWithTheme(
- <GenericField
- formState={FormState.READY}
- config={{
- name: 'field-name',
- label: 'field label',
- type: 'text',
- }}
- />
- );
- expect(wrapper.find('TextField')).toHaveLength(1);
- });
- it('renders text with choices as SelectCreatableField', function () {
- const wrapper = mountWithTheme(
- <GenericField
- formState={FormState.READY}
- config={{
- name: 'field-name',
- label: 'field label',
- type: 'text',
- choices: [],
- }}
- />
- );
- expect(wrapper.find('SelectCreatableField')).toHaveLength(1);
- });
- });
|