Skip to content

Open source CapCut alternative.

TypeScript

test(site): answer onboarding as done in the keys eval

David Lefbcbb806ea99
diff --git a/site/scripts/eval-cut-keys.ts b/site/scripts/eval-cut-keys.ts
index ebf9c0d1..bc7d15b4 100644
--- a/site/scripts/eval-cut-keys.ts
+++ b/site/scripts/eval-cut-keys.ts
@@ -24,6 +24,8 @@ import path from "node:path";
import { promisify } from "node:util";
import { chromium, type Locator, type Page } from "playwright";
+import { ONBOARDING_VERSION } from "../src/lib/onboarding/sequence";
+
const SITE = path.resolve(import.meta.dir, "..");
const REPORT = path.resolve(SITE, "..", "evals", "cut-keys.latest-report.json");
@@ -154,6 +156,22 @@ async function launch() {
}),
});
});
+ // The welcome sequence opens over the editor for an account that has yet to
+ // run it and covers the media panel. Answering the account read as finished
+ // keeps the eval on the editor, whatever the dev account's row says.
+ await context.route("**/api/account/onboarding*", async (route) => {
+ await route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ body: JSON.stringify({
+ version: ONBOARDING_VERSION,
+ completedAt: new Date(0).toISOString(),
+ skipped: false,
+ referralSources: [],
+ referralOther: null,
+ }),
+ });
+ });
const page = await context.newPage();
page.on("pageerror", (e) => console.log(`[pageerror] ${String(e).slice(0, 200)}`));
return { browser, page };