mirror of
https://github.com/apache/superset.git
synced 2026-04-10 03:45:22 +00:00
* ColorSchemeControl: fixing bad use of PropTypes Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs * Control: adding PropTypes.func in types allowed inside `value` prop This removes a warning during yarn tests Fix #3589 * tests(QueryStateLabel): removing missing prop warning ``` Warning: Failed prop type: The prop `query` is marked as required in `QueryStateLabel`, but its value is `undefined`. in QueryStateLabel ``` * SaveQuery: removing invalid prop `target` supplied to `Overlay`. This removes a warning during yarn tests: ``` Warning: Failed prop type: Invalid prop `target` supplied to `Overlay`. ``` * RunQueryActionButton: removing `isRequired` from queryState props This removes a warning during yarn tests: ``` Warning: Failed prop type: The prop `queryState` is marked as required in `RunQueryActionButton`, but its value is `null`. ```
25 lines
667 B
JavaScript
25 lines
667 B
JavaScript
import React from 'react';
|
|
import { Label } from 'react-bootstrap';
|
|
import { shallow } from 'enzyme';
|
|
import { describe, it } from 'mocha';
|
|
import { expect } from 'chai';
|
|
|
|
import QueryStateLabel from '../../../javascripts/SqlLab/components/QueryStateLabel';
|
|
|
|
describe('SavedQuery', () => {
|
|
const mockedProps = {
|
|
query: {
|
|
state: 'running',
|
|
},
|
|
};
|
|
it('is valid', () => {
|
|
expect(
|
|
React.isValidElement(<QueryStateLabel {...mockedProps} />),
|
|
).to.equal(true);
|
|
});
|
|
it('has an Overlay and a Popover', () => {
|
|
const wrapper = shallow(<QueryStateLabel {...mockedProps} />);
|
|
expect(wrapper.find(Label)).to.have.length(1);
|
|
});
|
|
});
|