Skip to content

Commit

Permalink
Use styledMount
Browse files Browse the repository at this point in the history
  • Loading branch information
geido committed Apr 6, 2022
1 parent 6b17f1d commit 6190d5d
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
* under the License.
*/
import React from 'react';
import { shallow } from 'enzyme';
import { styledMount as mount } from 'spec/helpers/theming';
import FilterBox from 'src/visualizations/FilterBox/FilterBox';
import SelectControl from 'src/explore/components/controls/SelectControl';
import { supersetTheme } from '@superset-ui/core';

describe('FilterBox', () => {
it('should only add defined non-predefined options to filtersChoices', () => {
const wrapper = shallow(
const wrapper = mount(
<FilterBox
chartId={1001}
datasource={{ id: 1 }}
Expand All @@ -47,11 +45,9 @@ describe('FilterBox', () => {
},
]}
origSelectedValues={{}}
theme={supersetTheme}
/>,
);
const component = wrapper.shallow();
const inst = component.instance();
const inst = wrapper.find('FilterBox').instance();
// choose a predefined value
inst.setState({ selectedValues: { name: ['John'] } });
expect(inst.props.filtersChoices.name.length).toEqual(2);
Expand Down

0 comments on commit 6190d5d

Please sign in to comment.