mirror of
https://github.com/apache/superset.git
synced 2026-04-10 11:55:24 +00:00
* react: using prop-types package to fix deprecated React.PropTypes property warning https://facebook.github.io/react/warnings/dont-call-proptypes.html * removing babel devDependency because has been deprecated in favor of babel-cli this fixes a warning during `npm install`: ``` npm WARN deprecated babel@6.23.0: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers ``` * js: setting ExploreActionButtons.queryEndpoint PropType as required because it's required in the child component DisplayQueryButton * js(tests): using object in expandedSlices prop type of SliceCell tests * js(tests): adding required props to SqlEditor mockedProps * js(tests): adding required prop editorHeight to TabbedSqlEditors mockedProps * js: removing unused moments dependency
25 lines
642 B
JavaScript
25 lines
642 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import { describe, it } from 'mocha';
|
|
import { expect } from 'chai';
|
|
import { slice } from './fixtures';
|
|
|
|
import SliceCell from '../../../javascripts/dashboard/components/SliceCell';
|
|
|
|
describe('SliceCell', () => {
|
|
const mockedProps = {
|
|
slice,
|
|
removeSlice: () => {},
|
|
expandedSlices: {},
|
|
};
|
|
it('is valid', () => {
|
|
expect(
|
|
React.isValidElement(<SliceCell {...mockedProps} />),
|
|
).to.equal(true);
|
|
});
|
|
it('renders five links', () => {
|
|
const wrapper = mount(<SliceCell {...mockedProps} />);
|
|
expect(wrapper.find('a')).to.have.length(5);
|
|
});
|
|
});
|