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
@@ -45,6 +45,21 @@ describe("ClampedText", () => {
}
});
it("starts another text collapsed: a reused view opening the next item", () => {
const tall = vi.spyOn(HTMLElement.prototype, "scrollHeight", "get").mockReturnValue(400);
const box = vi.spyOn(HTMLElement.prototype, "clientHeight", "get").mockReturnValue(60);
try {
const { rerender } = render(view("The first show's long summary."));
fireEvent.click(screen.getByText("More"));
rerender(view("The next show's long summary."));
expect(screen.getByText(/next show/).className).toContain("line-clamp-3");
expect(screen.getByText("More").getAttribute("aria-expanded")).toBe("false");
} finally {
tall.mockRestore();
box.mockRestore();
}
});
it("measures again when its box changes: the window or the text size moved the cut", () => {
const seen: ResizeObserverCallback[] = []; // the callbacks of observers watching something
const real = globalThis.ResizeObserver;