16812: Removed download attribute, fixed redirectTo
[arvados-workbench2.git] / src / common / redirect-to.test.ts
index ad8ac9e0c2354680948848ff1ba35593a61ee010..177e16566896e6f6d723d457ce7850d6b70b3444 100644 (file)
@@ -6,7 +6,10 @@ import { storeRedirects, handleRedirects } from './redirect-to';
 
 describe('redirect-to', () => {
     const { location } = window;
-    const redirectTo = 'http://localhost/test123';
+    const config: any = {
+        keepWebServiceUrl: 'http://localhost'
+    };
+    const redirectTo = '/test123';
     const locationTemplate = {
         hash: '',
         hostname: '',
@@ -68,14 +71,11 @@ describe('redirect-to', () => {
         });
 
         it('should redirect to page when it is present in session storage', () => {
-            // given
-            const token = 'testToken';
-
             // when
-            handleRedirects(token);
+            handleRedirects(config);
 
             // then
-            expect(window.location.href).toBe(`${redirectTo}?api_token=${token}`);
+            expect(window.location.href).toBe(`${config.keepWebServiceUrl}${redirectTo}`);
         });
     });
 });
\ No newline at end of file