mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
[dashboard v2] add MissingChart component in the case that chart component has no slice definition, add tests. (#5296)
This commit is contained in:
committed by
Grace Guo
parent
17b4298401
commit
04fc1d1089
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import Loading from '../../../../src/components/Loading';
|
||||
import MissingChart from '../../../../src/dashboard/components/MissingChart';
|
||||
|
||||
describe('MissingChart', () => {
|
||||
function setup(overrideProps) {
|
||||
const wrapper = shallow(<MissingChart height={100} {...overrideProps} />);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
it('renders a .missing-chart-container', () => {
|
||||
const wrapper = setup();
|
||||
expect(wrapper.find('.missing-chart-container')).to.have.length(1);
|
||||
});
|
||||
|
||||
it('renders a .missing-chart-body', () => {
|
||||
const wrapper = setup();
|
||||
expect(wrapper.find('.missing-chart-body')).to.have.length(1);
|
||||
});
|
||||
|
||||
it('renders a Loading', () => {
|
||||
const wrapper = setup();
|
||||
expect(wrapper.find(Loading)).to.have.length(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user