fix: tag counts, chip focus, upload naming, share links and unsized clips hold after round 2
- A tag counts the followed channels the Subscriptions tab shows: hidden ones are left out, and a subscribe, unsubscribe, hide or tag toggle refreshes the count. The Tag manager's row and its hover list count the same channels as the chip; /api/tags sends both counts under their names. - A chip's count keeps the chip's colour after a dot (a dimmed count fell under 4.5:1). A pick in the open "+N" fold closes it; a chip that leaves the list hands the focus to the one in its place. The fold is a dialog of toggle buttons, not an empty menu. - Upload: a folder name left by a press is made once the press is over, if the dialog is still open, instead of guessing a dismissal from Modal's markup. While the folder is made, its place holds the focus and a live region says so. - Share: an expired link has no Copy and a warn badge; the link made on open goes into the cached list, so a reopen makes no second one; the New link form survives the link made on open. - Watch: a repeated Enter sends one unlock while one is on its way. See all buttons are named with their rail. - An unsized clip of a rotated file gets the upright size its crop cut.
This commit is contained in:
@@ -294,6 +294,22 @@ describe("WatchPage honest failures", () => {
|
||||
expect(page.getByRole("button", { name: button })).toBeTruthy();
|
||||
});
|
||||
|
||||
it("a repeated Enter sends one try while it is on its way", async () => {
|
||||
window.history.replaceState({}, "", "/watch/tok-enter");
|
||||
const fetchMock = vi.fn().mockResolvedValueOnce(res(200, { needs_password: true }));
|
||||
fetchMock.mockImplementation(() => new Promise(() => {}));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
const page = render(<WatchPage />);
|
||||
const field = await page.findByPlaceholderText("Enter password");
|
||||
fireEvent.change(field, { target: { value: "guess" } });
|
||||
fireEvent.keyDown(field, { key: "Enter" });
|
||||
await waitFor(() => expect(fetchMock).toHaveBeenCalledTimes(2));
|
||||
fireEvent.keyDown(field, { key: "Enter" });
|
||||
fireEvent.keyDown(field, { key: "Enter" });
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
expect(fetchMock).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it("too many password tries says so, and keeps the form", async () => {
|
||||
window.history.replaceState({}, "", "/watch/tok-429");
|
||||
const page = await tryPassword(async () => res(429));
|
||||
|
||||
Reference in New Issue
Block a user