33import { render , type TemplateResult } from "lit" ;
44import { afterEach , describe , expect , it , vi } from "vitest" ;
55import type { GatewayBrowserClient } from "../api/gateway.ts" ;
6+ import { waitForFast } from "../test-helpers/wait-for.ts" ;
67import type { ApplicationRuntime } from "./bootstrap.ts" ;
78import type { ApplicationContext , ApplicationGatewaySnapshot } from "./context.ts" ;
89import "./app-host.ts" ;
@@ -121,7 +122,7 @@ function createPairingShell(params: {
121122 // replaces the eager loading shell with the full dialog.
122123 const renderPairingDialog = async ( ) => {
123124 renderSidebar ( ) ;
124- return await vi . waitFor ( ( ) => {
125+ return await waitForFast ( ( ) => {
125126 render ( shell . render ( ) , container ) ;
126127 const dialog = container . querySelector < HTMLElement > (
127128 '.device-pair-setup:not([aria-busy="true"])' ,
@@ -302,7 +303,7 @@ describe("application shell pairing access", () => {
302303
303304 button ?. click ( ) ;
304305
305- await vi . waitFor ( ( ) => expect ( button ?. textContent ?. trim ( ) ) . toBe ( "Copy failed" ) ) ;
306+ await waitForFast ( ( ) => expect ( button ?. textContent ?. trim ( ) ) . toBe ( "Copy failed" ) ) ;
306307 expect ( button ?. getAttribute ( "aria-label" ) ) . toBe ( "Copy failed" ) ;
307308 expect ( button ?. querySelector ( "svg" ) ) . not . toBeNull ( ) ;
308309 expect ( writeText ) . toHaveBeenCalledWith ( "pair-mobile-secret" ) ;
@@ -328,7 +329,7 @@ describe("application shell pairing access", () => {
328329 } ) ;
329330
330331 renderSidebar ( ) ;
331- await vi . waitFor ( ( ) => {
332+ await waitForFast ( ( ) => {
332333 render ( shell . render ( ) , container ) ;
333334 expect ( container . querySelector ( '[role="timer"]' ) ?. textContent ) . toContain ( "0:01" ) ;
334335 } ) ;
0 commit comments