[Fix] Update log filter test to match empty-result behavior

The test expected fallback to all logs when backend filters return empty,
but the source was intentionally changed to show empty results instead of
stale data. Updated test to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-16 18:19:02 -07:00
parent 616b311dec
commit a771fe55e4

View file

@ -451,7 +451,7 @@ describe("useLogFilterLogic", () => {
);
});
it("should fall back to logs when backend filters are active but API returns empty", async () => {
it("should return empty results when backend filters are active but API returns empty", async () => {
vi.mocked(uiSpendLogsCall).mockResolvedValue({
data: [],
total: 0,
@ -474,8 +474,7 @@ describe("useLogFilterLogic", () => {
{ timeout: 500 },
);
expect(result.current.filteredLogs.data).toHaveLength(1);
expect(result.current.filteredLogs.data[0].request_id).toBe("client-req");
expect(result.current.filteredLogs.data).toHaveLength(0);
});
it("should refetch when sortBy changes and backend filters are active", async () => {