From f56c65d879c1724cf37a1d5ef709568620b3a3d4 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Thu, 10 Aug 2023 23:51:24 +0800 Subject: [PATCH] test: bypass redirect --- __tests__/utils.ts | 6 +++++- src/components/Gitako.tsx | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/__tests__/utils.ts b/__tests__/utils.ts index 51c4533..8ec9157 100644 --- a/__tests__/utils.ts +++ b/__tests__/utils.ts @@ -87,7 +87,11 @@ export async function waitForRedirect(action?: () => void | Promise) { fired = true return action() }) - return Promise.race([waitForLegacyPJAXRedirect($action), waitForTurboRedirect($action)]) + return Promise.race([ + waitForLegacyPJAXRedirect($action), + waitForTurboRedirect($action), + sleep(3 * 1000), + ]) } export async function patientClick(selector: string) { diff --git a/src/components/Gitako.tsx b/src/components/Gitako.tsx index 3151b60..76bc18b 100644 --- a/src/components/Gitako.tsx +++ b/src/components/Gitako.tsx @@ -12,9 +12,10 @@ import { RepoContextWrapper } from '../containers/RepoContext' import { StateBarStateContextWrapper } from '../containers/SideBarState' export function Gitako() { + const mountPoint = React.useMemo(() => insertMountPoint(), []) return ( - +