mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
test(setup): share client descriptor fixtures (#16103)
This commit is contained in:
1 parent
753cd9d51b
commit
48cb8187c8
1 file changed
+20
-58
@@ -50,6 +50,20 @@ const msixClaudeDesktop = (
|
||||
},
|
||||
});
|
||||
|
||||
const codexClient = (): SetupClient => ({
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
});
|
||||
|
||||
const cursorClient = (): SetupClient => ({
|
||||
name: "cursor",
|
||||
registrationProfile: supportedClientRegistrationProfile("cursor"),
|
||||
displayName: "Cursor",
|
||||
configPath: "/cursor.json",
|
||||
});
|
||||
|
||||
describe("setup workflow", () => {
|
||||
it("omits an aligned managed skill from an otherwise empty plan", async () => {
|
||||
const host = new FakeSetupHost();
|
||||
@@ -113,14 +127,7 @@ describe("setup workflow", () => {
|
||||
|
||||
it("blocks malformed client configuration before Hopper or file mutation", async () => {
|
||||
const host = new FakeSetupHost();
|
||||
host.clients = [
|
||||
{
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
},
|
||||
];
|
||||
host.clients = [codexClient()];
|
||||
host.clientInspections.set("codex", {
|
||||
status: "invalid",
|
||||
remediation: "Repair the existing TOML.",
|
||||
@@ -150,12 +157,7 @@ describe("setup workflow", () => {
|
||||
displayName: "Claude Desktop",
|
||||
configPath: "/claude.json",
|
||||
},
|
||||
{
|
||||
name: "cursor",
|
||||
registrationProfile: supportedClientRegistrationProfile("cursor"),
|
||||
displayName: "Cursor",
|
||||
configPath: "/cursor.json",
|
||||
},
|
||||
cursorClient(),
|
||||
];
|
||||
host.clientInspections.set("claude_desktop", {
|
||||
status: "invalid",
|
||||
@@ -225,14 +227,7 @@ describe("setup workflow", () => {
|
||||
|
||||
it("plans a client update when Hopper installation changes its desired environment", async () => {
|
||||
const host = new FakeSetupHost();
|
||||
host.clients = [
|
||||
{
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
},
|
||||
];
|
||||
host.clients = [codexClient()];
|
||||
host.clientInspections.set("codex", { status: "already_current" });
|
||||
|
||||
const result = await runSetup(
|
||||
@@ -477,20 +472,7 @@ describe("setup workflow action selection", () => {
|
||||
const host = new FakeSetupHost();
|
||||
host.hopper = "/Applications/Hopper";
|
||||
host.skill = "unchanged";
|
||||
host.clients = [
|
||||
{
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
},
|
||||
{
|
||||
name: "cursor",
|
||||
registrationProfile: supportedClientRegistrationProfile("cursor"),
|
||||
displayName: "Cursor",
|
||||
configPath: "/cursor.json",
|
||||
},
|
||||
];
|
||||
host.clients = [codexClient(), cursorClient()];
|
||||
|
||||
const result = await runSetup(
|
||||
{ ...options(false), structured: false },
|
||||
@@ -515,20 +497,7 @@ describe("setup workflow action selection", () => {
|
||||
host.hopper = "/Applications/Hopper";
|
||||
host.skill = "unchanged";
|
||||
host.clients = [];
|
||||
host.availableClients = [
|
||||
{
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
},
|
||||
{
|
||||
name: "cursor",
|
||||
registrationProfile: supportedClientRegistrationProfile("cursor"),
|
||||
displayName: "Cursor",
|
||||
configPath: "/cursor.json",
|
||||
},
|
||||
];
|
||||
host.availableClients = [codexClient(), cursorClient()];
|
||||
host.clientInspections.set("cursor", {
|
||||
status: "invalid",
|
||||
remediation: "Repair the deselected Cursor configuration.",
|
||||
@@ -826,14 +795,7 @@ describe("MSIX Claude Desktop setup", () => {
|
||||
const host = new FakeSetupHost("win32");
|
||||
host.hopper = join(PROFILE, "Hopper");
|
||||
host.registrationCommandBlocker = "Install REA outside the package.";
|
||||
host.clients = [
|
||||
{
|
||||
name: "codex",
|
||||
registrationProfile: supportedClientRegistrationProfile("codex"),
|
||||
displayName: "Codex",
|
||||
configPath: "/codex.toml",
|
||||
},
|
||||
];
|
||||
host.clients = [codexClient()];
|
||||
|
||||
const blocked = await runSetup(
|
||||
{ ...options(true), clientIds: ["codex"] },
|
||||
|
||||
Reference in new issue
Block a user