[ARVADOS-WORKBENCH2] updated: 1.4.1-435-gcde4f5bc
Git user
git at public.arvados.org
Mon Sep 28 15:33:09 UTC 2020
Summary of changes:
src/common/redirect-to.test.ts | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
via cde4f5bcb537f69e6b0bc2349cbd0f27944a6f65 (commit)
from 4361d82d939fb3d8d6009b6bdfb66922634ba005 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit cde4f5bcb537f69e6b0bc2349cbd0f27944a6f65
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Mon Sep 28 17:31:27 2020 +0200
16812: Another way of testing href
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/src/common/redirect-to.test.ts b/src/common/redirect-to.test.ts
index 94000a98..3dad8233 100644
--- a/src/common/redirect-to.test.ts
+++ b/src/common/redirect-to.test.ts
@@ -5,16 +5,19 @@
import { storeRedirects, handleRedirects } from './redirect-to';
describe('redirect-to', () => {
+ const { location } = window;
const redirectTo = 'http://localhost/test123';
+ afterAll((): void => {
+ window.location = location;
+ });
+
describe('storeRedirects', () => {
beforeEach(() => {
- Object.defineProperty(window, 'location', {
- value: {
- href: `${window.location.href}?redirectTo=${redirectTo}`
- },
- writable: true
- });
+ delete window.location;
+ window.location = {
+ href: `${location.href}?redirectTo=${redirectTo}`,
+ };
Object.defineProperty(window, 'sessionStorage', {
value: {
setItem: jest.fn(),
@@ -34,12 +37,10 @@ describe('redirect-to', () => {
describe('handleRedirects', () => {
beforeEach(() => {
- Object.defineProperty(window, 'location', {
- value: {
- href: ''
- },
- writable: true
- });
+ delete window.location;
+ window.location = {
+ href: `${location.href}?redirectTo=${redirectTo}`,
+ };
Object.defineProperty(window, 'sessionStorage', {
value: {
getItem: () => redirectTo,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list