diff --git a/public/app/features/alerting/TestRuleButton.tsx b/public/app/features/alerting/TestRuleButton.tsx index 032d7c7e4f8..f9927b1a182 100644 --- a/public/app/features/alerting/TestRuleButton.tsx +++ b/public/app/features/alerting/TestRuleButton.tsx @@ -15,10 +15,10 @@ interface State { } export class TestRuleButton extends PureComponent { - constructor(props) { - super(props); - this.state = { isLoading: false, testRuleResponse: {} }; - } + readonly state: State = { + isLoading: false, + testRuleResponse: {}, + }; componentDidMount() { this.testRule(); @@ -39,10 +39,6 @@ export class TestRuleButton extends PureComponent { return ; } - return ( - <> - - - ); + return ; } } diff --git a/public/app/features/alerting/__snapshots__/TestRuleButton.test.tsx.snap b/public/app/features/alerting/__snapshots__/TestRuleButton.test.tsx.snap index 0e1c95d7233..d1ed3e64e99 100644 --- a/public/app/features/alerting/__snapshots__/TestRuleButton.test.tsx.snap +++ b/public/app/features/alerting/__snapshots__/TestRuleButton.test.tsx.snap @@ -1,15 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Render should render component 1`] = ` - - - + } + json={Object {}} + open={3} +/> `; diff --git a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx index 95397b884c8..ebf57613699 100644 --- a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx +++ b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx @@ -52,7 +52,7 @@ export class EditorTabBody extends PureComponent { onToggleToolBarView = (item: EditorToolbarView) => { this.setState({ openView: item, - isOpen: this.state.openView !== item ? true : !this.state.isOpen, + isOpen: this.state.openView !== item || !this.state.isOpen, }); };