Fix tests errors and warnings - iteration 5 (#12212) (#12224)

This commit is contained in:
Michael S. Molina
2021-01-26 04:35:57 -03:00
committed by GitHub
parent 20503f92ae
commit 22d52eadb2
8 changed files with 17 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ function setup(overrides) {
const onClose = sinon.spy();
const props = {
adhocMetric: sumValueAdhocMetric,
savedMetric: {},
savedMetric: { metric_name: 'foo', expression: 'COUNT(*)' },
savedMetrics: [],
onChange,
onClose,

View File

@@ -34,7 +34,7 @@ const defaultProps = {
describe('ColorPickerControl', () => {
let wrapper;
let inst;
beforeEach(() => {
beforeAll(() => {
getCategoricalSchemeRegistry()
.registerValue(
'test',

View File

@@ -45,7 +45,7 @@ describe('datasourcepanel', () => {
datasource,
},
},
actions: null,
actions: {},
};
it('should render', () => {
const { container } = render(

View File

@@ -44,8 +44,10 @@ const mockProps = {
},
timeout: 1000,
chart: {
id: 0,
queryResponse: {},
},
chartHeight: '30px',
};
describe('ExploreChartHeader', () => {

View File

@@ -33,7 +33,9 @@ describe('MetricDefinitionOption', () => {
}
it('renders a MetricOption given a saved metric', () => {
const wrapper = setup({ option: { metric_name: 'a_saved_metric' } });
const wrapper = setup({
option: { metric_name: 'a_saved_metric', expression: 'COUNT(*)' },
});
expect(wrapper.find(MetricOption)).toExist();
});

View File

@@ -33,7 +33,11 @@ const sumValueAdhocMetric = new AdhocMetric({
describe('MetricDefinitionValue', () => {
it('renders a MetricOption given a saved metric', () => {
const wrapper = shallow(
<MetricDefinitionValue option={{ metric_name: 'a_saved_metric' }} />,
<MetricDefinitionValue
onMetricEdit={() => {}}
option={{ metric_name: 'a_saved_metric', expression: 'COUNT(*)' }}
index={1}
/>,
);
expect(wrapper.find('AdhocMetricOption')).toExist();
});
@@ -43,6 +47,7 @@ describe('MetricDefinitionValue', () => {
<MetricDefinitionValue
onMetricEdit={() => {}}
option={sumValueAdhocMetric}
index={1}
/>,
);
expect(wrapper.find(AdhocMetricOption)).toExist();