fix(feed): the count pill dims while a new search's count loads

keepPreviousData held the last filter's count, and a broad word's count
takes seconds: the pill showed the old number as the new search's. It now
dims and is aria-busy until the new count lands, as AdminLogs does.
This commit is contained in:
2026-10-03 01:01:46 +02:00
parent e0e28c006c
commit c74ceb73e3
4 changed files with 116 additions and 4 deletions
@@ -62,4 +62,12 @@ describe("ItemCount", () => {
expect(text()).toBe(""); // the Layers icon carries no text
expect(screen.getByTestId("item-count").getAttribute("title")).toBeNull();
});
it("dims the previous filter's count and marks it busy while the new one loads", () => {
const { rerender } = render(<ItemCount count={5} />);
expect(screen.getByTestId("item-count").getAttribute("aria-busy")).toBeNull();
rerender(<ItemCount count={5} stale />);
expect(screen.getByTestId("item-count").getAttribute("aria-busy")).toBe("true");
expect(screen.getByText("5 items").className).toContain("opacity-60");
});
});