mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 03:15:46 -06:00
fix(test): use activated service worker build signal (#126584)
This commit is contained in:
committed by
GitHub
parent
3801331d22
commit
36ca7df091
@@ -458,22 +458,7 @@ describe("Control UI service-worker production update E2E", () => {
|
||||
await expect
|
||||
.poll(async () => (await gateway.getRequests("connect")).at(-1)?.params)
|
||||
.toMatchObject({ client: { buildId: buildB } });
|
||||
await page.waitForFunction((expectedBuildId) => {
|
||||
const controller = navigator.serviceWorker.controller;
|
||||
return (
|
||||
controller?.state === "activated" &&
|
||||
new URL(controller.scriptURL).searchParams.get("v") === expectedBuildId
|
||||
);
|
||||
}, buildB);
|
||||
expect(
|
||||
await page.evaluate(() => {
|
||||
const controller = navigator.serviceWorker.controller;
|
||||
return {
|
||||
buildId: controller ? new URL(controller.scriptURL).searchParams.get("v") : null,
|
||||
state: controller?.state ?? null,
|
||||
};
|
||||
}),
|
||||
).toEqual({ buildId: buildB, state: "activated" });
|
||||
await expect.poll(() => readWorkerUpdateVersions(page)).toContain(buildB);
|
||||
|
||||
const terminal = page.locator("openclaw-terminal-panel[embedded]");
|
||||
await terminal.waitFor({ state: "attached" });
|
||||
|
||||
Reference in New Issue
Block a user