diff --git a/.changelog/2089.internal.md b/.changelog/2089.internal.md new file mode 100644 index 0000000000..fc7c6ba7eb --- /dev/null +++ b/.changelog/2089.internal.md @@ -0,0 +1 @@ +Override API in e2e tests to allow quick backend switch diff --git a/playwright/utils/mockApi.ts b/playwright/utils/mockApi.ts index a2f8e3f210..a5be1a9690 100644 --- a/playwright/utils/mockApi.ts +++ b/playwright/utils/mockApi.ts @@ -9,6 +9,7 @@ import type { } from '../../src/vendors/oasisscan/index' export async function mockApi(context: BrowserContext | Page, balance: number) { + await context.addInitScript(() => ((window as any).REACT_APP_BACKEND = 'oasisscan')) await context.route('**/chain/account/info/*', route => { route.fulfill({ body: JSON.stringify({ diff --git a/src/app/components/Footer/__tests__/index.test.tsx b/src/app/components/Footer/__tests__/index.test.tsx index ce7bafb176..8f93fe9be3 100644 --- a/src/app/components/Footer/__tests__/index.test.tsx +++ b/src/app/components/Footer/__tests__/index.test.tsx @@ -60,12 +60,6 @@ describe('