From a8b5d6e9bfa6e8a6d949b920473aad7dbed3a5cc Mon Sep 17 00:00:00 2001 From: Shekhar Patel <90516956+duplixx@users.noreply.github.com> Date: Sat, 11 Nov 2023 00:58:30 +0530 Subject: [PATCH] Update SecuredRouteForUser.test.tsx --- .../SecuredRouteForUser.test.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.test.tsx b/src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.test.tsx index 7bfc440cf6..80df7f5e49 100644 --- a/src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.test.tsx +++ b/src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.test.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { MemoryRouter, Route } from 'react-router-dom'; import { render, screen, waitFor } from '@testing-library/react'; import SecuredRouteForUser from './SecuredRouteForUser'; @@ -10,12 +9,17 @@ describe('SecuredRouteForUser', () => { render( - ( -
- Organizations Component -
+ render={() => ( + ( +
+ Organizations Component +
+ )} + /> )} />
@@ -42,12 +46,8 @@ describe('SecuredRouteForUser', () => { ); - // Ensure that the redirect to / occurred - // waitFor(() => { - // expect(window.location.pathname).toBe('/user'); - // } - await waitFor(() => { - expect(window.location.pathname).toBe('/'); - }); + await waitFor(() => { + expect(window.location.pathname).toBe('/'); + }); }); });