From c896b9b2cded44e2f30a90f0c3ce5d87e8a823c5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 10 Aug 2026 21:40:03 -0700 Subject: [PATCH] test(ui): remove duplicate update confirmation cases (#121836) --- .../app/update-confirmation.runtime.test.ts | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/ui/src/app/update-confirmation.runtime.test.ts b/ui/src/app/update-confirmation.runtime.test.ts index fec57f9ffb23..0f544a0b61a8 100644 --- a/ui/src/app/update-confirmation.runtime.test.ts +++ b/ui/src/app/update-confirmation.runtime.test.ts @@ -67,58 +67,6 @@ afterEach(() => { } }); -it("states the target, restart impact, and both versions without starting the update", async () => { - const postMessage = installNativeBridge(); - const { settled, startGatewayUpdate } = startUpdate(); - const { modal, dialog } = await getRenderedModalDialog(document.body); - - expect(dialog.getAttribute("aria-label")).toBe("Update Gateway"); - expect(modal.textContent).toContain( - "Installs the available update on the connected Gateway and restarts it.", - ); - expect(modal.textContent).toContain("this Control UI disconnects until the Gateway is back"); - expect(modal.textContent).toContain("Installed v1.0.0 ยท Available v2.0.0"); - // The confirm action names the operation; a generic "Yes" would not. - expect(findButton("Update and restart")).toBeInstanceOf(HTMLButtonElement); - expect(findButton("Cancel").hasAttribute("autofocus")).toBe(true); - expect(startGatewayUpdate).not.toHaveBeenCalled(); - expect(postMessage).not.toHaveBeenCalled(); - - findButton("Cancel").click(); - await settled; -}); - -it.each([ - { dismiss: () => findButton("Cancel").click(), name: "Cancel" }, - { - dismiss: () => { - const modal = document.body.querySelector("openclaw-modal-dialog"); - modal?.dispatchEvent(new CustomEvent("modal-cancel", { bubbles: true, composed: true })); - }, - name: "Escape or modal dismissal", - }, -])("sends nothing when the operator chooses $name", async ({ dismiss }) => { - const postMessage = installNativeBridge(); - const { settled, startGatewayUpdate } = startUpdate({ viaNativeApp: true }); - await getRenderedModalDialog(document.body); - - dismiss(); - await settled; - - expect(startGatewayUpdate).not.toHaveBeenCalled(); - expect(postMessage).not.toHaveBeenCalled(); -}); - -it("starts exactly one Gateway update after an explicit confirmation", async () => { - const { settled, startGatewayUpdate } = startUpdate(); - await getRenderedModalDialog(document.body); - - findButton("Update and restart").click(); - await settled; - - expect(startGatewayUpdate).toHaveBeenCalledOnce(); -}); - it("hands a confirmed update to the Mac app instead of the Gateway", async () => { const postMessage = installNativeBridge(); const { settled, startGatewayUpdate } = startUpdate({ viaNativeApp: true });