test: stabilize CLI hint assertions under CLAWDBOT_PROFILE (#2507)

This commit is contained in:
Vignesh
2026-01-26 19:20:54 -08:00
committed by GitHub
parent 959ddae612
commit b151b8d196
9 changed files with 22 additions and 9 deletions

View File

@@ -370,7 +370,7 @@ describe("channels command", () => {
});
expect(lines.join("\n")).toMatch(/Warnings:/);
expect(lines.join("\n")).toMatch(/Message Content Intent is disabled/i);
expect(lines.join("\n")).toMatch(/Run: clawdbot doctor/);
expect(lines.join("\n")).toMatch(/Run: clawdbot( --profile isolated)? doctor/);
});
it("surfaces Discord permission audit issues in channels status output", () => {

View File

@@ -234,6 +234,8 @@ describe("buildGatewayInstallPlan", () => {
describe("gatewayInstallErrorHint", () => {
it("returns platform-specific hints", () => {
expect(gatewayInstallErrorHint("win32")).toContain("Run as administrator");
expect(gatewayInstallErrorHint("linux")).toContain("clawdbot gateway install");
expect(gatewayInstallErrorHint("linux")).toMatch(
/clawdbot( --profile isolated)? gateway install/,
);
});
});

View File

@@ -239,7 +239,7 @@ describe("onboard-hooks", () => {
// Second note should confirm configuration
expect(noteCalls[1][0]).toContain("Enabled 1 hook: session-memory");
expect(noteCalls[1][0]).toContain("clawdbot hooks list");
expect(noteCalls[1][0]).toMatch(/clawdbot( --profile isolated)? hooks list/);
});
});
});

View File

@@ -130,7 +130,7 @@ describe("sandboxListCommand", () => {
expectLogContains(runtime, "⚠️");
expectLogContains(runtime, "image mismatch");
expectLogContains(runtime, "clawdbot sandbox recreate --all");
expectLogContains(runtime, "sandbox recreate --all");
});
it("should display message when no containers found", async () => {

View File

@@ -312,7 +312,13 @@ describe("statusCommand", () => {
expect(logs.some((l) => l.includes("FAQ:"))).toBe(true);
expect(logs.some((l) => l.includes("Troubleshooting:"))).toBe(true);
expect(logs.some((l) => l.includes("Next steps:"))).toBe(true);
expect(logs.some((l) => l.includes("clawdbot status --all"))).toBe(true);
expect(
logs.some(
(l) =>
l.includes("clawdbot status --all") ||
l.includes("clawdbot --profile isolated status --all"),
),
).toBe(true);
});
it("shows gateway auth when reachable", async () => {