- 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.
17 lines
613 B
TypeScript
17 lines
613 B
TypeScript
// @vitest-environment jsdom
|
|
//
|
|
// An auto-skip's countdown starts below zero: the wait before it, while the Skip button already
|
|
// shows. The bar it draws must read empty through the wait, not a negative width.
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { skipCountdown } from "./plexPlayerHooks";
|
|
|
|
describe("skipCountdown", () => {
|
|
it("stays empty through the wait, runs over the delay, and stops at full", () => {
|
|
expect(skipCountdown(-3, 5)).toBe(0);
|
|
expect(skipCountdown(-0.1, 5)).toBe(0);
|
|
expect(skipCountdown(2.5, 5)).toBe(0.5);
|
|
expect(skipCountdown(7, 5)).toBe(1);
|
|
});
|
|
});
|