mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
refactor: Replace react-bootstrap tooltips with Antd tooltips (#11737)
* Refactor tooltip in ColumnElement * Refactor tooltip for Button * Remove redundant import * Refactor tooltip in SqlEditor * Increase line height in tooltip so that the text is centered * Refactor tooltip in Link * Refactor tooltip in AdhocMetricEditPopoverTitle * Refactor tooltip from ControlHeader * Refactor tooltip in DateFilterControl * Refactor tooltip in VizTypeControl * fixup! Refactor tooltip in AdhocMetricEditPopoverTitle * Refactor tooltip in QueryAndSaveBtns * fixup! Refactor tooltip in DateFilterControl * Refactor tooltip in CopyToClipboard, fix cursor pointer * Refactor tooltip in TooltipWrapper * Refactor tooltip in Field/DatasourceEditor * Remove redundant import * Fix typing for placement prop * Decrease margin in ColumnElement divider * Change default export to named * Move SqlLab Tooltip styles to Emotion * Fix tests
This commit is contained in:
committed by
GitHub
parent
75086f8979
commit
9b68b65568
@@ -20,7 +20,7 @@
|
||||
import React from 'react';
|
||||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
import { Tooltip } from 'src/common/components/Tooltip';
|
||||
|
||||
import AdhocMetricEditPopoverTitle from 'src/explore/components/AdhocMetricEditPopoverTitle';
|
||||
|
||||
@@ -43,16 +43,18 @@ function setup(overrides) {
|
||||
describe('AdhocMetricEditPopoverTitle', () => {
|
||||
it('renders an OverlayTrigger wrapper with the title', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(OverlayTrigger)).toExist();
|
||||
expect(wrapper.find(OverlayTrigger).find('span').text()).toBe(
|
||||
'My Metric\xa0',
|
||||
);
|
||||
expect(wrapper.find(Tooltip)).toExist();
|
||||
expect(
|
||||
wrapper.find('[data-test="AdhocMetricEditTitle#trigger"]').text(),
|
||||
).toBe('My Metric\xa0');
|
||||
});
|
||||
|
||||
it('transfers to edit mode when clicked', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.state('isEditable')).toBe(false);
|
||||
wrapper.simulate('click');
|
||||
wrapper
|
||||
.find('[data-test="AdhocMetricEditTitle#trigger"]')
|
||||
.simulate('click');
|
||||
expect(wrapper.state('isEditable')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user