From f14cf6b91028b8e2bfee9de20cc2de0fdb429952 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 20 Aug 2026 23:02:46 -0700 Subject: [PATCH] perf(test): speed up pairing access polling (#127047) --- ui/src/app/app-host-pairing-access.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/app/app-host-pairing-access.test.ts b/ui/src/app/app-host-pairing-access.test.ts index f1a8c32ec5ce..7290979cf8af 100644 --- a/ui/src/app/app-host-pairing-access.test.ts +++ b/ui/src/app/app-host-pairing-access.test.ts @@ -3,6 +3,7 @@ import { render, type TemplateResult } from "lit"; import { afterEach, describe, expect, it, vi } from "vitest"; import type { GatewayBrowserClient } from "../api/gateway.ts"; +import { waitForFast } from "../test-helpers/wait-for.ts"; import type { ApplicationRuntime } from "./bootstrap.ts"; import type { ApplicationContext, ApplicationGatewaySnapshot } from "./context.ts"; import "./app-host.ts"; @@ -121,7 +122,7 @@ function createPairingShell(params: { // replaces the eager loading shell with the full dialog. const renderPairingDialog = async () => { renderSidebar(); - return await vi.waitFor(() => { + return await waitForFast(() => { render(shell.render(), container); const dialog = container.querySelector( '.device-pair-setup:not([aria-busy="true"])', @@ -302,7 +303,7 @@ describe("application shell pairing access", () => { button?.click(); - await vi.waitFor(() => expect(button?.textContent?.trim()).toBe("Copy failed")); + await waitForFast(() => expect(button?.textContent?.trim()).toBe("Copy failed")); expect(button?.getAttribute("aria-label")).toBe("Copy failed"); expect(button?.querySelector("svg")).not.toBeNull(); expect(writeText).toHaveBeenCalledWith("pair-mobile-secret"); @@ -328,7 +329,7 @@ describe("application shell pairing access", () => { }); renderSidebar(); - await vi.waitFor(() => { + await waitForFast(() => { render(shell.render(), container); expect(container.querySelector('[role="timer"]')?.textContent).toContain("0:01"); });