From 8cc930b756ef2d7027621350c9a49c90323f53a3 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 30 Sep 2026 18:26:37 +0200 Subject: [PATCH] test(app): reproduce silent revert of the archive merged PR workspaces switch When the host rejects the change, the switch goes back to off and no message is shown on web or desktop. Refs #5769. --- .../settings-auto-archive-merged.spec.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/app/e2e/browser/settings-auto-archive-merged.spec.ts diff --git a/packages/app/e2e/browser/settings-auto-archive-merged.spec.ts b/packages/app/e2e/browser/settings-auto-archive-merged.spec.ts new file mode 100644 index 0000000000..6f94d881b2 --- /dev/null +++ b/packages/app/e2e/browser/settings-auto-archive-merged.spec.ts @@ -0,0 +1,42 @@ +import { readFile, writeFile } from "node:fs/promises"; +import path from "node:path"; +import { expect, test, type Page } from "../support/fixtures"; +import { gotoAppShell, openSettings } from "../support/helpers/app"; +import { getServerId } from "../support/helpers/server-id"; +import { openHostSection, openSettingsHost } from "../support/helpers/settings"; + +// Reproduction for https://github.com/getpaseo/paseo/issues/5769: when the host rejects +// the change, the switch goes back to off and the app says nothing about why. +test.describe("Archive merged PR workspaces setting", () => { + test("a rejected change tells the user why the switch went back off", async ({ page }) => { + const serverId = getServerId(); + await gotoAppShell(page); + await openSettings(page); + await openSettingsHost(page, serverId); + await openHostSection(page, serverId, "workspaces"); + const toggle = archiveMergedSwitch(page); + await expect(toggle).toHaveAttribute("aria-checked", "false"); + + await withUnreadableDaemonConfig(async () => { + await toggle.click(); + + await expect(toggle).toHaveAttribute("aria-checked", "false"); + await expect(page.getByText("Unable to update workspaces")).toBeVisible(); + }); + }); +}); + +function archiveMergedSwitch(page: Page) { + return page.getByRole("switch", { name: "Archive merged PR workspaces" }); +} + +async function withUnreadableDaemonConfig(run: () => Promise): Promise { + const configPath = path.join(process.env.E2E_PASEO_HOME!, "config.json"); + const original = await readFile(configPath, "utf8"); + await writeFile(configPath, "{ not json"); + try { + await run(); + } finally { + await writeFile(configPath, original); + } +}