[dashboard v2] add MissingChart component in the case that chart component has no slice definition, add tests. (#5296)

This commit is contained in:
Chris Williams
2018-06-27 11:20:10 -07:00
committed by Grace Guo
parent 17b4298401
commit 04fc1d1089
6 changed files with 95 additions and 10 deletions

View File

@@ -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);
});
});