Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Oct 25, 2017
1 parent f2384a3 commit 9b4705e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
16 changes: 11 additions & 5 deletions packages/api-explorer-ui/__tests__/AuthBox.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ test('should merge securities auth changes', () => {
const onChange = jest.fn();
const authBox = mount(<AuthBox {...props} onChange={onChange} />);

authBox.find('ApiKey').props().change('auth')
authBox.find('Oauth2').props().change('auth')

expect(onChange.mock.calls[0][0]).toEqual({ auth: { apiKey: 'auth' } })
expect(onChange.mock.calls[1][0]).toEqual({ auth: { apiKey: 'auth', oauth: 'auth' } })
authBox
.find('ApiKey')
.props()
.change('auth');
authBox
.find('Oauth2')
.props()
.change('auth');

expect(onChange.mock.calls[0][0]).toEqual({ auth: { apiKey: 'auth' } });
expect(onChange.mock.calls[1][0]).toEqual({ auth: { apiKey: 'auth', oauth: 'auth' } });
});
4 changes: 2 additions & 2 deletions packages/api-explorer-ui/src/AuthBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ class AuthBox extends React.Component {
this.onChange = this.onChange.bind(this);
}
componentDidUpdate(prevProps, prevState) {
if (prevState.auth !== this.state.auth) this.props.onChange({ auth: this.state.auth })
if (prevState.auth !== this.state.auth) this.props.onChange({ auth: this.state.auth });
}
onChange(auth) {
this.setState(previousState => {
return {
auth: Object.assign({}, previousState.auth, auth),
};
})
});
}
render() {
const { authInputRef, operation, onSubmit, open, needsAuth, toggle } = this.props;
Expand Down
4 changes: 2 additions & 2 deletions packages/api-explorer-ui/src/lib/Oas.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Operation {
return false;
}

return keys.map((key) => {
return keys.map(key => {
let security;
try {
security = this.oas.components.securitySchemes[key];
Expand All @@ -56,7 +56,7 @@ class Operation {
})
.filter(Boolean)
.reduce((prev, securities) => {
securities.forEach((security) => {
securities.forEach(security => {
if (!prev[security.type]) prev[security.type] = [];
prev[security.type].push(security.security);
});
Expand Down

0 comments on commit 9b4705e

Please sign in to comment.