import { jsx as _jsx } from "react/jsx-runtime";
import React from "react";
import { renderToString } from "ink";
import { describe, expect, it } from "vitest";
import { PlanActionBar } from "./PlanOverlay.js";
import { ThemeContext, loadTheme } from "../theme/theme.js";
function stripAnsi(value) {
    return value.replace(new RegExp(String.raw `\u001B\[[0-?]*[ -/]*[@-~]`, "g"), "");
}
function renderActionBar(node) {
    return stripAnsi(renderToString(_jsx(ThemeContext.Provider, { value: loadTheme("dark"), children: node })));
}
describe("PlanActionBar", () => {
    it("renders approve/reject controls in the same compact TUI row style", () => {
        const output = renderActionBar(_jsx(PlanActionBar, { planName: "review", confirmDelete: false, rejectMode: false, rejectFeedback: "" }));
        expect(output.trim()).toBe("◇ a approve · r reject · d delete · q back · ESC close");
    });
    it("renders reject feedback as a bottom input-style prompt", () => {
        const output = renderActionBar(_jsx(PlanActionBar, { planName: "review", confirmDelete: false, rejectMode: true, rejectFeedback: "Need more risk notes" }));
        expect(output).toContain("Feedback (Enter to submit, Esc to cancel):");
        expect(output).toContain("> Need more risk notes▍");
    });
});
//# sourceMappingURL=PlanOverlay.test.js.map