From 3df3e0d6814e7aa87b9332999c38f149ac2d0cd2 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Thu, 12 Oct 2017 06:07:52 +0200 Subject: [PATCH] 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`. ``` --- .../javascripts/SqlLab/components/RunQueryActionButton.jsx | 2 +- superset/assets/javascripts/SqlLab/components/SaveQuery.jsx | 1 - superset/assets/javascripts/explore/components/Control.jsx | 3 ++- .../explore/components/controls/ColorSchemeControl.jsx | 2 +- .../assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx | 5 ----- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx b/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx index 60437d3913..6b6cdad6e1 100644 --- a/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx +++ b/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx @@ -6,7 +6,7 @@ import { t } from '../../locales'; const propTypes = { allowAsync: PropTypes.bool.isRequired, dbId: PropTypes.number, - queryState: PropTypes.string.isRequired, + queryState: PropTypes.string, runQuery: PropTypes.func.isRequired, selectedText: PropTypes.string, stopQuery: PropTypes.func.isRequired, diff --git a/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx b/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx index d932fc4618..8ab1b22ad0 100644 --- a/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx +++ b/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx @@ -112,7 +112,6 @@ class SaveQuery extends React.PureComponent { { }, }; it('is valid', () => { - expect( - React.isValidElement(), - ).to.equal(true); - }); - it('is valid with props', () => { expect( React.isValidElement(), ).to.equal(true);