mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
1. fix check filters change logic (#4339)
2. should show chart after loading completed
This commit is contained in:
@@ -6,6 +6,8 @@ import sinon from 'sinon';
|
||||
|
||||
import { chart as initChart } from '../../../javascripts/chart/chartReducer';
|
||||
import Chart from '../../../javascripts/chart/Chart';
|
||||
import ChartBody from '../../../javascripts/chart/ChartBody';
|
||||
import Loading from '../../../javascripts/components/Loading';
|
||||
|
||||
describe('Chart', () => {
|
||||
const chart = {
|
||||
@@ -30,15 +32,20 @@ describe('Chart', () => {
|
||||
},
|
||||
};
|
||||
|
||||
let wrapper;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<Chart {...mockedProps} />,
|
||||
);
|
||||
});
|
||||
describe('renderViz', () => {
|
||||
let wrapper;
|
||||
let stub;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<Chart {...mockedProps} />,
|
||||
);
|
||||
stub = sinon.stub(wrapper.instance(), 'renderViz');
|
||||
});
|
||||
afterEach(() => {
|
||||
stub.restore();
|
||||
});
|
||||
|
||||
it('should not call when loading', () => {
|
||||
const prevProp = wrapper.props();
|
||||
@@ -68,4 +75,11 @@ describe('Chart', () => {
|
||||
expect(stub.callCount).to.equals(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('render', () => {
|
||||
it('should render ChartBody after loading is completed', () => {
|
||||
expect(wrapper.find(Loading)).to.have.length(1);
|
||||
expect(wrapper.find(ChartBody)).to.have.length(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user