Manage stakeholders implemented

This commit is contained in:
adilallo
2026-05-09 23:07:59 -06:00
parent 534c6c7c0e
commit 9f2141a62d
43 changed files with 2082 additions and 93 deletions
@@ -38,6 +38,8 @@ const config: ComponentTestSuiteConfig<CreateFlowTopNavProps> = {
onShare: vi.fn(),
onSelectExportFormat: vi.fn(),
onEdit: vi.fn(),
hasManageStakeholders: true,
onManageStakeholders: vi.fn(),
onExit: vi.fn(),
className: "test-class",
},
@@ -121,6 +123,33 @@ describe("CreateFlowTopNav (behavioral tests)", () => {
expect(editButton).toBeInTheDocument();
});
it("renders Manage Stakeholders when hasManageStakeholders is true", () => {
render(
<CreateFlowTopNav
hasManageStakeholders={true}
onManageStakeholders={vi.fn()}
/>,
);
expect(
screen.getByRole("button", { name: "Manage Stakeholders" }),
).toBeInTheDocument();
});
it("calls onManageStakeholders when Manage Stakeholders is clicked", async () => {
const user = userEvent.setup();
const handler = vi.fn();
render(
<CreateFlowTopNav
hasManageStakeholders={true}
onManageStakeholders={handler}
/>,
);
await user.click(
screen.getByRole("button", { name: "Manage Stakeholders" }),
);
expect(handler).toHaveBeenCalledTimes(1);
});
it("calls onExit when Exit button is clicked", async () => {
const user = userEvent.setup();
const handleExit = vi.fn();