// @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); }); });