Files
kandev/apps/web/components/settings/ssh-agent-readiness-card.test.ts
T
2026-06-29 19:06:33 +01:00

24 lines
907 B
TypeScript

import { describe, expect, it } from "vitest";
import { readinessDisplayShell, readinessProbeBody } from "./ssh-agent-readiness-card";
describe("ssh agent readiness shell selection", () => {
it("omits shell override when the profile has no explicit shell", () => {
expect(readinessProbeBody("")).toEqual({});
expect(readinessProbeBody(" ")).toEqual({});
});
it("trims and sends explicit shell choices", () => {
expect(readinessProbeBody(" zsh ")).toEqual({ shell: "zsh" });
});
it("displays the detected default when no explicit shell is saved", () => {
expect(readinessDisplayShell("", "zsh")).toBe("zsh");
expect(readinessDisplayShell(" ", "zsh")).toBe("zsh");
expect(readinessDisplayShell("", "")).toBe("bash");
});
it("displays explicit shell choices over detected defaults", () => {
expect(readinessDisplayShell("bash", "zsh")).toBe("bash");
});
});