mirror of
https://github.com/apache/superset.git
synced 2026-04-08 02:45:22 +00:00
refactor: Use Modals from Antd instead of react-bootstrap (#11330)
* Refactor ModalTrigger to use antd modal * Refactor a few components * dynamic width * Fix unit tests * Use i18n for button text
This commit is contained in:
committed by
GitHub
parent
144b279aa2
commit
894ca3c09b
@@ -21,6 +21,7 @@ import { mount } from 'enzyme';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
import { DisplayQueryButton } from 'src/explore/components/DisplayQueryButton';
|
||||
import { MenuItem } from 'react-bootstrap';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
|
||||
describe('DisplayQueryButton', () => {
|
||||
const defaultProps = {
|
||||
@@ -43,7 +44,12 @@ describe('DisplayQueryButton', () => {
|
||||
);
|
||||
});
|
||||
it('renders a dropdown', () => {
|
||||
const wrapper = mount(<DisplayQueryButton {...defaultProps} />);
|
||||
const wrapper = mount(<DisplayQueryButton {...defaultProps} />, {
|
||||
wrappingComponent: ThemeProvider,
|
||||
wrappingComponentProps: {
|
||||
theme: supersetTheme,
|
||||
},
|
||||
});
|
||||
expect(wrapper.find(ModalTrigger)).toHaveLength(3);
|
||||
expect(wrapper.find(MenuItem)).toHaveLength(5);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user