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