fix(filters): a pick that hides More… keeps the focus, counts read alike, Plex facets say they failed
Picking in the year dialog the one year the chips hid took More… away with the dialog, and the focus fell to <body>: it now goes to the picked year's chip. A count badge is compact in the UI language everywhere (a chip read "17200" beside its cell's "17.2K"). While the Plex facets load or fail, the sections they fill say so instead of vanishing as if the library had none.
This commit is contained in:
@@ -64,6 +64,27 @@ describe("the Plex rail's Year section", () => {
|
||||
expect(screen.queryByRole("button", { pressed: true })).toBeNull();
|
||||
});
|
||||
|
||||
it("says the years are loading, or failed to load, rather than showing none", () => {
|
||||
const { rerender } = render(
|
||||
<PlexYearFilter
|
||||
filters={EMPTY_PLEX_FILTERS}
|
||||
facets={undefined}
|
||||
facetsState="loading"
|
||||
patch={() => {}}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByRole("status").textContent).toBe("common.loading");
|
||||
rerender(
|
||||
<PlexYearFilter
|
||||
filters={EMPTY_PLEX_FILTERS}
|
||||
facets={undefined}
|
||||
facetsState="error"
|
||||
patch={() => {}}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByRole("alert").textContent).toBe("common.loadError");
|
||||
});
|
||||
|
||||
it("names the range fields", () => {
|
||||
render(<PlexYearFilter filters={EMPTY_PLEX_FILTERS} facets={FACETS} patch={() => {}} />);
|
||||
expect(screen.getByRole("spinbutton", { name: "plex.filter.yearFrom" })).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user