fix: ColorSchemeControl should not use CreatableSelect (#10814)

* fix: ColorSchemeControl should not be CreatableSelect

   Currently if you type to search in ColorSchemeControl it crashes the
whole page.

* Make it possible to filter by label

* Fix ColorSchemeControl unit test
This commit is contained in:
Jesse Yang
2020-09-08 18:38:50 -07:00
committed by GitHub
parent 3ae80d3b98
commit cda232bf15
3 changed files with 32 additions and 16 deletions

View File

@@ -19,12 +19,14 @@
/* eslint-disable no-unused-expressions */
import React from 'react';
import { mount } from 'enzyme';
import Creatable from 'react-select/creatable';
import { Select } from 'src/components/Select';
import { getCategoricalSchemeRegistry } from '@superset-ui/color';
import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
const defaultProps = {
name: 'color_scheme',
label: 'Color Scheme',
options: getCategoricalSchemeRegistry()
.keys()
.map(s => [s, s]),
@@ -37,6 +39,6 @@ describe('ColorSchemeControl', () => {
});
it('renders a Creatable', () => {
expect(wrapper.find(Creatable)).toExist();
expect(wrapper.find(Select)).toExist();
});
});