fix(i18n): redirect based on Referer header (#40512)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Mrugesh Mohapatra
2020-12-21 22:23:06 +05:30
committed by Mrugesh Mohapatra
parent a3b1b52cdd
commit 77c46dba2c
10 changed files with 162 additions and 78 deletions

View File

@@ -1,7 +1,7 @@
/* global jest, expect */
import React from 'react';
import ShallowRenderer from 'react-test-renderer/shallow';
import { apiLocation, homeLocation } from '../../config/env.json';
import { apiLocation } from '../../config/env.json';
import { ShowSettings } from './ShowSettings';
@@ -22,9 +22,7 @@ describe('<ShowSettings />', () => {
const shallow = new ShallowRenderer();
shallow.render(<ShowSettings {...loggedOutProps} />);
expect(navigate).toHaveBeenCalledTimes(1);
expect(navigate).toHaveBeenCalledWith(
`${apiLocation}/signin?returnTo=${homeLocation}/settings`
);
expect(navigate).toHaveBeenCalledWith(`${apiLocation}/signin`);
const result = shallow.getRenderOutput();
// Renders Loader rather than ShowSettings
expect(result.type.displayName).toBe('Loader');