From 1621a29e72a76be1e9fc597eaf3e5cab6da51691 Mon Sep 17 00:00:00 2001 From: Omar Alshaker Date: Fri, 10 Jan 2025 23:28:59 +0100 Subject: [PATCH] Fix test --- .../hooks/use-sign-up-start-tracking/test/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/test/index.tsx b/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/test/index.tsx index d3ed2a5de96b5f..94b5dbd5a167a3 100644 --- a/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/test/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/test/index.tsx @@ -43,11 +43,14 @@ const render = ( { flow, queryParams = {} } ) => { flow, } ), { - wrapper: ( { children } ) => ( - - { children } - - ), + wrapper: ( { children } ) => { + // The hook depends on window.location.search to determine the query params. + Reflect.deleteProperty( global.window, 'location' ); + window.location = new URL( + 'https://example.com/' + addQueryArgs( `/setup/${ flow.name }`, queryParams ) + ) as unknown as Location; + return { children }; + }, } ); };