mirror of
https://github.com/apache/superset.git
synced 2026-04-10 20:06:13 +00:00
feat: add hook for dataset health check (#11970)
* feat: add hook for dataset health check * add event log * optimize datasource json data like certified data * add unit test * fix review comments * extra code review comments
This commit is contained in:
@@ -24,6 +24,8 @@ import { Menu } from 'src/common/components';
|
||||
import DatasourceModal from 'src/datasource/DatasourceModal';
|
||||
import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal';
|
||||
import DatasourceControl from 'src/explore/components/controls/DatasourceControl';
|
||||
import Icon from 'src/components/Icon';
|
||||
import { Tooltip } from 'src/common/components/Tooltip';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'datasource',
|
||||
@@ -40,6 +42,7 @@ const defaultProps = {
|
||||
backend: 'mysql',
|
||||
name: 'main',
|
||||
},
|
||||
health_check_message: 'Warning message!',
|
||||
},
|
||||
actions: {
|
||||
setDatasource: sinon.spy(),
|
||||
@@ -91,4 +94,14 @@ describe('DatasourceControl', () => {
|
||||
);
|
||||
expect(menuWrapper.find(Menu.Item)).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('should render health check message', () => {
|
||||
const wrapper = setup();
|
||||
const alert = wrapper.find(Icon).first();
|
||||
expect(alert.prop('name')).toBe('alert-solid');
|
||||
const tooltip = wrapper.find(Tooltip).at(1);
|
||||
expect(tooltip.prop('title')).toBe(
|
||||
defaultProps.datasource.health_check_message,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user