mirror of https://github.com/apache/superset.git
Fixing some warnings during tests (#3648)
* 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`. ```
This commit is contained in:
parent
4a3c09187a
commit
3df3e0d681
|
@ -6,7 +6,7 @@ import { t } from '../../locales';
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
allowAsync: PropTypes.bool.isRequired,
|
allowAsync: PropTypes.bool.isRequired,
|
||||||
dbId: PropTypes.number,
|
dbId: PropTypes.number,
|
||||||
queryState: PropTypes.string.isRequired,
|
queryState: PropTypes.string,
|
||||||
runQuery: PropTypes.func.isRequired,
|
runQuery: PropTypes.func.isRequired,
|
||||||
selectedText: PropTypes.string,
|
selectedText: PropTypes.string,
|
||||||
stopQuery: PropTypes.func.isRequired,
|
stopQuery: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -112,7 +112,6 @@ class SaveQuery extends React.PureComponent {
|
||||||
<span className="SaveQuery">
|
<span className="SaveQuery">
|
||||||
<Overlay
|
<Overlay
|
||||||
trigger="click"
|
trigger="click"
|
||||||
target={this.state.target}
|
|
||||||
show={this.state.showSave}
|
show={this.state.showSave}
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
animation={this.props.animation}
|
animation={this.props.animation}
|
||||||
|
|
|
@ -22,7 +22,8 @@ const propTypes = {
|
||||||
PropTypes.string,
|
PropTypes.string,
|
||||||
PropTypes.number,
|
PropTypes.number,
|
||||||
PropTypes.bool,
|
PropTypes.bool,
|
||||||
PropTypes.array]),
|
PropTypes.array,
|
||||||
|
PropTypes.func]),
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
|
|
@ -12,7 +12,7 @@ const propTypes = {
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
default: PropTypes.string,
|
default: PropTypes.string,
|
||||||
choices: PropTypes.arrayOf(React.PropTypes.array).isRequired,
|
choices: PropTypes.arrayOf(PropTypes.array).isRequired,
|
||||||
schemes: PropTypes.object.isRequired,
|
schemes: PropTypes.object.isRequired,
|
||||||
isLinear: PropTypes.bool,
|
isLinear: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,11 +13,6 @@ describe('SavedQuery', () => {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
it('is valid', () => {
|
it('is valid', () => {
|
||||||
expect(
|
|
||||||
React.isValidElement(<QueryStateLabel />),
|
|
||||||
).to.equal(true);
|
|
||||||
});
|
|
||||||
it('is valid with props', () => {
|
|
||||||
expect(
|
expect(
|
||||||
React.isValidElement(<QueryStateLabel {...mockedProps} />),
|
React.isValidElement(<QueryStateLabel {...mockedProps} />),
|
||||||
).to.equal(true);
|
).to.equal(true);
|
||||||
|
|
Loading…
Reference in New Issue