|
|
@@ -100,6 +100,7 @@ it("从页头导出,表格分开展示两种状态,改筛选时返回第一
|
|
|
it.each(["", "?month=all"])("默认查询全部自然月并支持选月和重置(查询串 %j)", async (search) => {
|
|
|
renderPage(search);
|
|
|
const monthTrigger = screen.getByRole("button", { name: "自然月:全部自然月" });
|
|
|
+ expect(within(monthTrigger).getByText("全部自然月").classList.contains("is-placeholder")).toBe(true);
|
|
|
await waitFor(() => expect(reconGetList).toHaveBeenLastCalledWith(expect.objectContaining({ period: undefined })));
|
|
|
await screen.findByRole("link", { name: "RECON-001" });
|
|
|
fireEvent.click(screen.getByRole("button", { name: "导出当前结果" }));
|
|
|
@@ -114,9 +115,11 @@ it.each(["", "?month=all"])("默认查询全部自然月并支持选月和重置
|
|
|
fireEvent.click(october);
|
|
|
await waitFor(() => expect(reconGetList).toHaveBeenLastCalledWith(expect.objectContaining({ period: "2026-10" })));
|
|
|
expect(screen.getByRole("button", { name: "自然月:2026-10" })).toBe(monthTrigger);
|
|
|
+ expect(within(monthTrigger).getByText("2026-10").classList.contains("is-placeholder")).toBe(false);
|
|
|
|
|
|
fireEvent.click(screen.getByRole("button", { name: "重置筛选" }));
|
|
|
expect(screen.getByRole("button", { name: "自然月:全部自然月" })).toBe(monthTrigger);
|
|
|
+ expect(within(monthTrigger).getByText("全部自然月").classList.contains("is-placeholder")).toBe(true);
|
|
|
await waitFor(() => expect(reconGetList).toHaveBeenLastCalledWith(expect.objectContaining({ period: undefined })));
|
|
|
});
|
|
|
|