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