describe('redirect-to', () => {
const { location } = window;
const config: any = {
- keepWebServiceUrl: 'http://localhost'
+ keepWebServiceUrl: 'http://localhost',
+ keepWebServiceInlineUrl: 'http://localhost-inline'
};
- const redirectTo = '/test123';
+ const redirectTo = 'c=acbd18db4cc2f85cedef654fccc4a4d8%2B3/foo';
const locationTemplate = {
hash: '',
hostname: '',
delete window.location;
window.location = {
...locationTemplate,
- href: `${location.href}?redirectTo=${redirectTo}`,
+ href: `${location.href}?redirectToDownload=${redirectTo}`,
} as any;
- Object.defineProperty(window, 'sessionStorage', {
+ Object.defineProperty(window, 'localStorage', {
value: {
setItem: jest.fn(),
},
storeRedirects();
// then
- expect(window.sessionStorage.setItem).toHaveBeenCalledWith('redirectTo', redirectTo);
+ expect(window.localStorage.setItem).toHaveBeenCalledWith('redirectToDownload', decodeURIComponent(redirectTo));
});
});
delete window.location;
window.location = {
...locationTemplate,
- href: `${location.href}?redirectTo=${redirectTo}`,
+ href: `${location.href}?redirectToDownload=${redirectTo}`,
} as any;;
- Object.defineProperty(window, 'sessionStorage', {
+ Object.defineProperty(window, 'localStorage', {
value: {
getItem: () => redirectTo,
removeItem: jest.fn(),