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:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user