Skip to content

Commit

Permalink
extra code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace committed Dec 16, 2020
1 parent 975d275 commit 9800606
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ 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',
Expand Down Expand Up @@ -96,7 +97,11 @@ describe('DatasourceControl', () => {

it('should render health check message', () => {
const wrapper = setup();
const icons = wrapper.find(Icon);
expect(icons.first().prop('name')).toBe('alert-solid');
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,
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const Styles = styled.div`
vertical-align: middle;
cursor: pointer;
}
.datasource-controls {
display: flex;
}
`;

/**
Expand Down Expand Up @@ -219,7 +223,7 @@ class DatasourceControl extends React.PureComponent {
return (
<Styles className="DatasourceControl">
<ControlHeader {...this.props} />
<div style={{ display: 'flex' }}>
<div className="datasource-controls">
<Tooltip title={t('Expand/collapse dataset configuration')}>
<Label
style={{ textTransform: 'none' }}
Expand Down

0 comments on commit 9800606

Please sign in to comment.