mirror of
https://github.com/apache/superset.git
synced 2026-04-09 03:16:07 +00:00
* Bumping react==16.4.1 & enzyme==3.3.0 The upgrade was pretty smooth except for a cryptic message coming out of react-select around running multiple copies of React. It turns out the `common` bundle had React and was conflicting with explore and dashboard apps, only in 16.x. This somehow wasn't a problem in 15.x outside of the wasted resources. Running 16.4 should bring in all sorts of perf improvements and features we've all been waiting for. https://reactjs.org/blog/2017/09/26/react-v16.0.html TODO: react-bootstrap-datetimepicker isn't compatible with React 16 * Trying to deprecate react-bootstrap-datetime * Moving forward * Reintroducing tests
31 lines
885 B
JavaScript
31 lines
885 B
JavaScript
import React from 'react';
|
|
import { expect } from 'chai';
|
|
import { describe, it } from 'mocha';
|
|
import { mount } from 'enzyme';
|
|
import ModalTrigger from './../../../../src/components/ModalTrigger';
|
|
|
|
import DisplayQueryButton from '../../../../src/explore/components/DisplayQueryButton';
|
|
|
|
describe('DisplayQueryButton', () => {
|
|
const defaultProps = {
|
|
animation: false,
|
|
queryResponse: {
|
|
query: 'SELECT * FROM foo',
|
|
language: 'sql',
|
|
},
|
|
chartStatus: 'success',
|
|
queryEndpoint: 'localhost',
|
|
latestQueryFormData: {
|
|
datasource: '1__table',
|
|
},
|
|
};
|
|
|
|
it('is valid', () => {
|
|
expect(React.isValidElement(<DisplayQueryButton {...defaultProps} />)).to.equal(true);
|
|
});
|
|
it('renders a dropdown', () => {
|
|
const wrapper = mount(<DisplayQueryButton {...defaultProps} />);
|
|
expect(wrapper.find(ModalTrigger)).to.have.lengthOf(2);
|
|
});
|
|
});
|