Commit 236d7b12 by Hugo Häggmark

Changes after PR comments

parent 67e8958a
...@@ -15,10 +15,10 @@ interface State { ...@@ -15,10 +15,10 @@ interface State {
} }
export class TestRuleButton extends PureComponent<Props, State> { export class TestRuleButton extends PureComponent<Props, State> {
constructor(props) { readonly state: State = {
super(props); isLoading: false,
this.state = { isLoading: false, testRuleResponse: {} }; testRuleResponse: {},
} };
componentDidMount() { componentDidMount() {
this.testRule(); this.testRule();
...@@ -39,10 +39,6 @@ export class TestRuleButton extends PureComponent<Props, State> { ...@@ -39,10 +39,6 @@ export class TestRuleButton extends PureComponent<Props, State> {
return <LoadingPlaceholder text="Evaluating rule" />; return <LoadingPlaceholder text="Evaluating rule" />;
} }
return ( return <JSONFormatter json={testRuleResponse} />;
<>
<JSONFormatter json={testRuleResponse} />
</>
);
} }
} }
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render should render component 1`] = ` exports[`Render should render component 1`] = `
<Fragment> <JSONFormatter
<JSONFormatter
config={ config={
Object { Object {
"animateOpen": true, "animateOpen": true,
...@@ -10,6 +9,5 @@ exports[`Render should render component 1`] = ` ...@@ -10,6 +9,5 @@ exports[`Render should render component 1`] = `
} }
json={Object {}} json={Object {}}
open={3} open={3}
/> />
</Fragment>
`; `;
...@@ -52,7 +52,7 @@ export class EditorTabBody extends PureComponent<Props, State> { ...@@ -52,7 +52,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
onToggleToolBarView = (item: EditorToolbarView) => { onToggleToolBarView = (item: EditorToolbarView) => {
this.setState({ this.setState({
openView: item, openView: item,
isOpen: this.state.openView !== item ? true : !this.state.isOpen, isOpen: this.state.openView !== item || !this.state.isOpen,
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment