Skip to content

Commit

Permalink
fix(authentication): remove test block (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Jul 13, 2021
1 parent 896b9f8 commit 7b34b6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ exports[`Authentication Component should return a message on 401 error: 401 erro
</MessageView>
`;

exports[`Authentication Component should return a redirect on 418 error: 418 error 1`] = `"418 redirect"`;
exports[`Authentication Component should return a redirect on 418 error: 418 error 1`] = `
<withRouter(Redirect)
isRedirect={true}
route="/optin"
/>
`;

exports[`Authentication Component should return a redirect on a specific 403 error and error code: 403 error 1`] = `
<MessageView
Expand All @@ -307,4 +312,9 @@ exports[`Authentication Component should return a redirect on a specific 403 err
</MessageView>
`;

exports[`Authentication Component should return a redirect on a specific 403 error and error code: 403 redirect error 1`] = `"403 redirect"`;
exports[`Authentication Component should return a redirect on a specific 403 error and error code: 403 redirect error 1`] = `
<withRouter(Redirect)
isRedirect={true}
route="/optin"
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Authentication Component', () => {
</Authentication>
);

expect(component.html()).toMatchSnapshot('418 error');
expect(component).toMatchSnapshot('418 error');
});

it('should return a redirect on a specific 403 error and error code', () => {
Expand All @@ -88,7 +88,7 @@ describe('Authentication Component', () => {
</Authentication>
);

expect(component.html()).toMatchSnapshot('403 redirect error');
expect(component).toMatchSnapshot('403 redirect error');

component.setProps({
session: {
Expand Down
3 changes: 0 additions & 3 deletions src/components/authentication/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ class Authentication extends Component {
(session.errorCodes && session.errorCodes.includes(rhsmApiTypes.RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES.OPTIN)) ||
session.status === 418
) {
if (helpers.TEST_MODE) {
return <React.Fragment>{session.status} redirect</React.Fragment>;
}
return <Redirect isRedirect route={routerHelpers.getErrorRoute.path} />;
}

Expand Down

0 comments on commit 7b34b6b

Please sign in to comment.