diff --git a/frontend/src/pages/EnvironmentOverviewPage.test.tsx b/frontend/src/pages/EnvironmentOverviewPage.test.tsx index 00502fa..a4fcd39 100644 --- a/frontend/src/pages/EnvironmentOverviewPage.test.tsx +++ b/frontend/src/pages/EnvironmentOverviewPage.test.tsx @@ -84,7 +84,11 @@ describe("EnvironmentOverviewPage", () => { mockState = { status: empty, statusState: "success", statusError: "" }; renderPage(); expect(screen.getByText("尚未安装任何 Agent")).toBeTruthy(); - fireEvent.click(screen.getByRole("button", { name: "安装命令行 Agent" })); + // The header's "安装命令行 Agent" is deliberately absent here: with nothing + // installed the empty state owns the call to action, as its own primary + // button, rather than repeating it in the toolbar. + expect(screen.queryByRole("button", { name: "安装命令行 Agent" })).toBeNull(); + fireEvent.click(screen.getByRole("button", { name: "安装 Agent" })); expect(await screen.findByRole("heading", { name: "onboarding" })).toBeTruthy(); // A second run must not inherit the previous Agent, model or log. expect(dispatch).toHaveBeenCalledWith({ type: "START_SETUP" });