mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
fix: smooth scrubber end seeking (#386)
* fix: smooth scrubber end seeking * fix: stop timeline auto-scroll in fit mode * feat: use percentage-based timeline zoom * fix: sync timeline playhead on zoom changes * fix: reset timeline scroll when returning to fit * fix: keep timeline controls pinned
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveSeekPercent } from "./PlayerControls";
|
||||
|
||||
describe("resolveSeekPercent", () => {
|
||||
it("returns 0 when the track width is invalid", () => {
|
||||
expect(resolveSeekPercent(100, 0, 0)).toBe(0);
|
||||
});
|
||||
|
||||
it("snaps to the start within the edge threshold", () => {
|
||||
expect(resolveSeekPercent(105, 100, 200)).toBe(0);
|
||||
});
|
||||
|
||||
it("snaps to the end within the edge threshold", () => {
|
||||
expect(resolveSeekPercent(298, 100, 200)).toBe(1);
|
||||
});
|
||||
|
||||
it("preserves the true percent away from the edges", () => {
|
||||
expect(resolveSeekPercent(150, 100, 200)).toBe(0.25);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user