mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Fix flaky landingPage visual spec
This makes sure that the stubs are always loaded before the app. We assume that previously the load order was not deterministic due to the dynamic import. Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Vendored
+1
-1
@@ -18,7 +18,7 @@ declare global {
|
||||
// src/config.ts
|
||||
APP_CONFIG: Config;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
initializeTestStubs: Function;
|
||||
initializeTestStubs?: Function;
|
||||
e2eTestStubs: {
|
||||
FakeTimers: FakeTimers;
|
||||
};
|
||||
|
||||
+9
-1
@@ -1,4 +1,12 @@
|
||||
if (window.PLAYWRIGHT) import("@app/lib/e2eTestStubs");
|
||||
import * as FakeTimers from "@sinonjs/fake-timers";
|
||||
|
||||
if (window.PLAYWRIGHT && window.initializeTestStubs !== undefined) {
|
||||
window.e2eTestStubs = {
|
||||
FakeTimers: FakeTimers,
|
||||
};
|
||||
window.initializeTestStubs();
|
||||
}
|
||||
|
||||
import App from "@app/App.svelte";
|
||||
|
||||
const app = new App({
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import * as FakeTimers from "@sinonjs/fake-timers";
|
||||
|
||||
if (typeof window.initializeTestStubs === "function") {
|
||||
window.e2eTestStubs = {
|
||||
FakeTimers: FakeTimers,
|
||||
};
|
||||
window.initializeTestStubs();
|
||||
}
|
||||
Reference in New Issue
Block a user