mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
test(setup): scope simulated-Windows Claude Desktop uninstall to the client under test (#11137)
This commit is contained in:
1 parent
65731d8b23
commit
dc83adcbd4
1 file changed
+23
-5
@@ -29,6 +29,7 @@ import {
|
||||
import {
|
||||
runUninstall,
|
||||
systemUninstallHost,
|
||||
type UninstallHost,
|
||||
} from "../../../src/application/Uninstall.js";
|
||||
import { resolveMcpRegistrationClients } from "../../../src/application/McpRegistrationCatalog.js";
|
||||
import { ArtifactResourceScope } from "../../../src/artifacts/ArtifactResourceScope.js";
|
||||
@@ -76,6 +77,23 @@ const claudeDesktop = (
|
||||
return client;
|
||||
};
|
||||
|
||||
/**
|
||||
* Uninstall scoped to Claude Desktop. A simulated Windows profile on a POSIX
|
||||
* temp home has no drive letter, so clients that refuse driveless paths (Kilo)
|
||||
* would fail for reasons unrelated to these tests.
|
||||
*/
|
||||
const claudeDesktopUninstallHost = (
|
||||
home: string,
|
||||
env: Readonly<Record<string, string>>,
|
||||
): UninstallHost => {
|
||||
const host = systemUninstallHost(home, undefined, env, "win32");
|
||||
return {
|
||||
...host,
|
||||
clients: async () =>
|
||||
(await host.clients()).filter(({ name }) => name === "claude_desktop"),
|
||||
};
|
||||
};
|
||||
|
||||
const writeJson = async (path: string, value: unknown): Promise<void> => {
|
||||
await mkdir(dirname(path), { recursive: true });
|
||||
await writeFile(path, `${JSON.stringify(value, null, 2)}\n`);
|
||||
@@ -237,7 +255,7 @@ describe("Windows Claude Desktop configuration location", () => {
|
||||
).resolves.toEqual({ status: "failed", reason: "path" });
|
||||
const uninstall = await runUninstall(
|
||||
false,
|
||||
systemUninstallHost(home, undefined, env, "win32"),
|
||||
claudeDesktopUninstallHost(home, env),
|
||||
);
|
||||
expect(uninstall.status).toBe("failed");
|
||||
expect(uninstall.items).toContainEqual(
|
||||
@@ -348,7 +366,7 @@ it("preserves explicit AppData root whitespace throughout setup, doctor and unin
|
||||
});
|
||||
const uninstall = await runUninstall(
|
||||
false,
|
||||
systemUninstallHost(home, undefined, selected, "win32"),
|
||||
claudeDesktopUninstallHost(home, selected),
|
||||
);
|
||||
expect(uninstall.status).toBe("complete");
|
||||
expect(await readJson(appDataConfig)).toEqual(original);
|
||||
@@ -533,7 +551,7 @@ describe("MSIX Claude Desktop uninstall", () => {
|
||||
|
||||
const result = await runUninstall(
|
||||
false,
|
||||
systemUninstallHost(home, undefined, env, "win32"),
|
||||
claudeDesktopUninstallHost(home, env),
|
||||
);
|
||||
|
||||
expect(result.status).toBe("failed");
|
||||
@@ -558,7 +576,7 @@ describe("MSIX Claude Desktop uninstall", () => {
|
||||
await writeJson(appDataConfig, unrelated);
|
||||
const result = await runUninstall(
|
||||
false,
|
||||
systemUninstallHost(home, undefined, env, "win32"),
|
||||
claudeDesktopUninstallHost(home, env),
|
||||
);
|
||||
expect(result.status).toBe("complete");
|
||||
expect(await readJson(appDataConfig)).toEqual(unrelated);
|
||||
@@ -574,7 +592,7 @@ describe("MSIX Claude Desktop uninstall", () => {
|
||||
|
||||
const result = await runUninstall(
|
||||
false,
|
||||
systemUninstallHost(home, undefined, env, "win32"),
|
||||
claudeDesktopUninstallHost(home, env),
|
||||
);
|
||||
|
||||
expect(result.status).toBe("complete");
|
||||
|
||||
Reference in new issue
Block a user