fix(webui): simplify automation details

This commit is contained in:
chengyongru
2026-06-15 22:52:26 +08:00
parent 3aa90e539c
commit 87aaf8991a
12 changed files with 11 additions and 433 deletions
+6 -18
View File
@@ -628,21 +628,10 @@ describe("App layout", () => {
expect(within(detailPanel).getByRole("button", { name: "Show less" })).toBeInTheDocument();
expect(message!).not.toHaveClass("line-clamp-6");
expect(within(detailPanel).getByText("Recent health")).toBeInTheDocument();
expect(within(detailPanel).getByText("Issues: 2")).toBeInTheDocument();
const historyToggle = within(detailPanel).getByRole("button", { name: /Run history/ });
const historySection = historyToggle.closest("section") as HTMLElement;
expect(historySection).not.toBeNull();
expect(within(historySection).queryByText(/oldest failure/)).not.toBeInTheDocument();
expect(historyToggle).toHaveAttribute("aria-expanded", "false");
expect(historyToggle).toHaveTextContent("Runs: 6 · Issues: 2");
fireEvent.click(historyToggle);
expect(historyToggle).toHaveAttribute("aria-expanded", "true");
expect(within(historySection).getAllByText(/oldest failure/)).toHaveLength(2);
expect(within(detailPanel).getAllByText("No error recorded").length).toBeGreaterThanOrEqual(1);
fireEvent.click(historyToggle);
expect(historyToggle).toHaveAttribute("aria-expanded", "false");
expect(within(historySection).queryByText(/oldest failure/)).not.toBeInTheDocument();
expect(within(detailPanel).queryByText("Recent health")).not.toBeInTheDocument();
expect(within(detailPanel).queryByRole("button", { name: /Run history/ })).not.toBeInTheDocument();
expect(within(detailPanel).queryByText(/oldest failure/)).not.toBeInTheDocument();
expect(within(detailPanel).queryByText("No error recorded")).not.toBeInTheDocument();
});
it("localizes the Automations surface", async () => {
@@ -703,9 +692,8 @@ describe("App layout", () => {
expect(screen.getAllByText("每日检查").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("检查仓库状态").length).toBeGreaterThanOrEqual(1);
expect(screen.getByText("每 1天")).toBeInTheDocument();
expect(screen.getByText("最近健康状态")).toBeInTheDocument();
expect(screen.getByText("近期无问题")).toBeInTheDocument();
expect(screen.getByText(/最后运行于/)).toBeInTheDocument();
expect(screen.queryByText("最近健康状态")).not.toBeInTheDocument();
expect(screen.queryByText("近期无问题")).not.toBeInTheDocument();
expect(screen.queryByText("Workspace automations")).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "刷新" })).not.toBeInTheDocument();
expect(document.title).toBe("自动任务 · nanobot");
-6
View File
@@ -55,12 +55,6 @@ const LOCALIZED_SETTINGS_COPY_KEYS = [
"settings.automations.systemTask",
"settings.automations.labels.schedule",
"settings.automations.status.active",
"settings.automations.history.ok",
"settings.automations.history.health",
"settings.automations.history.summary",
"settings.automations.history.noRecentIssues",
"settings.automations.history.noError",
"settings.automations.duration.lessThanSecond",
"settings.automations.deleteTitle",
"settings.sections.interface",
"settings.sections.localPreferences",