import assert from "node:assert";
import { describe, it } from "node:test";
import { prettyPrintEnvironmentPrompt } from "./pretty-print-environment-prompt.js";
function makeEnv(environmentType, name = "my-env", branchName = "main") {
    return {
        name,
        accountName: "acme",
        projectName: "my-project",
        createdOn: null,
        branchName,
        environmentType,
    };
}
describe("prettyPrintEnvironmentPrompt", () => {
    describe("working-copy rendering", () => {
        const workingCopyVariants = [
            "working_copy",
            "working-copy",
            "development",
        ];
        for (const envType of workingCopyVariants) {
            it(`uses env.name and the recommendation hint for environmentType="${envType}"`, () => {
                const result = prettyPrintEnvironmentPrompt(makeEnv(envType, "wc-slug"));
                assert.strictEqual(result, "wc-slug — recommended for local development");
            });
        }
    });
    it("renders preview rows as the branch name only", () => {
        const result = prettyPrintEnvironmentPrompt(makeEnv("preview", "env-test-staging-bb91e0b", "staging"));
        assert.strictEqual(result, "staging");
        assert.ok(result.startsWith("s"), `Expected "s" prefix in "${result}"`);
    });
    it("renders production rows as the branch name only", () => {
        const result = prettyPrintEnvironmentPrompt(makeEnv("production", "env-test-prod-xyz789", "main"));
        assert.strictEqual(result, "main");
    });
    it("falls back to env.name when branchName is empty", () => {
        const env = makeEnv("preview", "env-test-fallback-abc123", "");
        assert.strictEqual(prettyPrintEnvironmentPrompt(env), "env-test-fallback-abc123");
    });
});
//# sourceMappingURL=pretty-print-environment-prompt.test.js.map