fix: share, upload, crop, auto-skip, tag chips and See all hold what they claim
- Share: a link that expired is never copied (the dialog and one-click Share pick a live one, else make one), says it expired, and the copy-on-open claim clears on the next copy. - A password-protected file link asks to open a file, not to watch a video. - Upload: Cancel, the close button or the backdrop while naming a folder makes no folder; a failed refetch keeps the target; a folder being made says so. - Crop: an infinite number is dropped, not a 500; an unprobed clip's size follows a shown-size crop; the edit_spec docs name frame_w/frame_h; the join and rotated paths are tested. - Auto-skip: the wait gives way on a marker too short for it, so the skip still fires. - Tag chips count the followed channels (subscribed_count) and a toggled chip keeps the focus. - Continue watching's See all sorts by last watched when in progress was already on.
This commit is contained in:
@@ -94,6 +94,22 @@ describe("quickShareLink", () => {
|
||||
expect(createDownloadLink).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
// An expired link stays listed for its owner, but its recipient would land on "link gone".
|
||||
it("passes over an expired link, and mints one when every link has expired", async () => {
|
||||
const lastWeek = new Date(Date.now() - 7 * 86400_000).toISOString();
|
||||
const nextWeek = new Date(Date.now() + 7 * 86400_000).toISOString();
|
||||
downloadLinks.mockResolvedValue([
|
||||
{ id: 5, url: "/watch/gone", expires_at: lastWeek },
|
||||
{ id: 3, url: "/watch/live", expires_at: nextWeek },
|
||||
]);
|
||||
expect(await quickShareLink(qc(), { kind: "file", id: 1 })).toBe(`${origin}/watch/live`);
|
||||
expect(createDownloadLink).not.toHaveBeenCalled();
|
||||
|
||||
downloadLinks.mockResolvedValue([{ id: 5, url: "/watch/gone", expires_at: lastWeek }]);
|
||||
createDownloadLink.mockResolvedValue({ id: 9, url: "/watch/fresh" });
|
||||
expect(await quickShareLink(qc(), { kind: "file", id: 2 })).toBe(`${origin}/watch/fresh`);
|
||||
});
|
||||
|
||||
it("mints a new link when none it has can be shown, keeping the old ones listed", async () => {
|
||||
const hidden = { id: 4, url: null };
|
||||
downloadLinks.mockResolvedValue([hidden]);
|
||||
|
||||
Reference in New Issue
Block a user