test(frontend): cover graph_exec_id filter apply path in PlatformCostContent

This commit is contained in:
majdyz
2026-04-15 19:45:36 +07:00
parent 9493c55108
commit a96517ccb5

View File

@@ -399,6 +399,26 @@ describe("PlatformCostContent", () => {
expect(input.value).toBe("");
});
it("passes execution ID to filter on Apply click", async () => {
mockUseGetDashboard.mockReturnValue({
data: emptyDashboard,
isLoading: false,
});
mockUseGetLogs.mockReturnValue({ data: emptyLogs, isLoading: false });
renderComponent();
await waitFor(() =>
expect(document.querySelector(".animate-pulse")).toBeNull(),
);
const input = screen.getByPlaceholderText(
"Filter by execution",
) as HTMLInputElement;
fireEvent.change(input, { target: { value: "exec-abc" } });
expect(input.value).toBe("exec-abc");
fireEvent.click(screen.getByText("Apply"));
// After apply, the input still holds the typed value
expect(input.value).toBe("exec-abc");
});
it("renders by-user tab when specified", async () => {
mockUseGetDashboard.mockReturnValue({
data: dashboardWithData,