fix(ui,i18n): E30 review round 3 — the stored language follows the screen, a fresh text starts collapsed, Retry waits again

This commit is contained in:
2026-10-01 10:43:59 +02:00
parent 08e62bbb16
commit 3563858fd1
14 changed files with 147 additions and 32 deletions
@@ -276,6 +276,29 @@ describe("PlexPersonView — a bio on its way (E30 S6)", () => {
}
});
it("a retry after the wait is over waits again: a bio still on its way still lands", async () => {
vi.useFakeTimers({ shouldAdvanceTime: true });
try {
plexPerson.mockReset();
plexPerson
.mockResolvedValueOnce(person({ biography: null, enriching: true }))
.mockRejectedValueOnce(new Error("server restarting"))
.mockResolvedValueOnce(person({ biography: null, enriching: true })) // the retry
.mockResolvedValue(person({ biography: "Late bio." }));
wrap(view);
await screen.findByText("Movie One");
await act(() => vi.advanceTimersByTimeAsync(BIO_POLL));
await act(() => vi.advanceTimersByTimeAsync(25_000)); // the first wait runs out
fireEvent.click(within(screen.getByRole("alert")).getByRole("button"));
await act(() => vi.advanceTimersByTimeAsync(10));
expect(screen.getByRole("status")).toBeTruthy(); // on its way again, not a blank
await act(() => vi.advanceTimersByTimeAsync(BIO_POLL));
await screen.findByText("Late bio.");
} finally {
vi.useRealTimers();
}
});
it("offers More only when the bio is cut, and Less once open", async () => {
const tall = vi.spyOn(HTMLElement.prototype, "scrollHeight", "get").mockReturnValue(400);
const box = vi.spyOn(HTMLElement.prototype, "clientHeight", "get").mockReturnValue(160);