1import { render } from "npm:preact-render-to-string@6.7.0";2import { RuntimeRecovery } from "./RuntimeRecovery.tsx";34Deno.test("RuntimeRecovery explains the explicit incompatible-broker action", () => {5 const html = render(6 <RuntimeRecovery7 failure={{8 code: "broker-incompatible",9 runtimeMode: "managed",10 message:11 "Another tab for this app is running an incompatible version. Close every other app tab, then reload this tab.",12 }}13 />,14 );15 for (16 const text of ["Close other app tabs", "will not reload or retry automatically", "Reload app"]17 ) {18 if (!html.includes(text)) throw new Error(`recovery UI omitted: ${text}`);19 }20});2122Deno.test("RuntimeRecovery stays hidden for startup failures without a browser-tab action", () => {23 const html = render(24 <RuntimeRecovery25 failure={{26 code: "unsupported-capabilities",27 runtimeMode: "local",28 message: "unsupported",29 }}30 />,31 );32 if (html) throw new Error("generic startup failure rendered broker recovery");33});