feat(selection): 重构信号详情展示,增加指标项和格式化功能

This commit is contained in:
yuxuanhui
2026-08-27 13:17:51 +08:00
parent 63e9006c2d
commit 71dfd22fb7
6 changed files with 146 additions and 45 deletions
@@ -102,9 +102,26 @@ describe("SelectionResultsPage", () => {
expect(screen.queryByText("目标股票数")).not.toBeInTheDocument()
const table = screen.getByRole("table")
expect(table).toBeInTheDocument()
expect(
within(table).getByRole("columnheader", { name: "信号类型" }),
).toBeInTheDocument()
expect(
within(table).getByRole("columnheader", { name: "J 值" }),
).toBeInTheDocument()
expect(
within(table).queryByRole("columnheader", { name: "关键详情" }),
).not.toBeInTheDocument()
expect(within(table).getByText("原始 B1")).toBeInTheDocument()
expect(within(table).getByText("回踩白线 B")).toBeInTheDocument()
expect(within(table).getAllByText("12")).toHaveLength(2)
expect(within(table).getAllByText("平安银行")).toHaveLength(2)
const detailPanel = screen.getByRole("complementary", {
name: "当前股票详情",
})
expect(within(detailPanel).getByText("关键指标")).toBeInTheDocument()
expect(within(detailPanel).getByText("J 值")).toBeInTheDocument()
expect(within(detailPanel).getByText("RSI")).toBeInTheDocument()
})
it("opens execution status details in a drawer and restores trigger focus", async () => {
@@ -330,10 +347,11 @@ describe("SelectionResultsPage", () => {
).getByText("招商银行"),
).toBeInTheDocument()
const expandButton = screen.getAllByRole("button", { name: "查看详情" })[0]
const expandButton = screen.getAllByRole("button", { name: "查看详情" })[2]
fireEvent.click(expandButton)
expect(expandButton).toHaveAttribute("aria-expanded", "true")
expect(screen.getAllByText("macd: 3.2").length).toBeGreaterThan(1)
expect(screen.getAllByText("MACD").length).toBeGreaterThan(1)
expect(screen.getAllByText("3.2").length).toBeGreaterThan(1)
})
it("navigates to another page when the result list is paginated", () => {