The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.
TypeScript agent-skillsagentic-aiai-agentsai-videobyokclaude-codecodexdeepseek-harnessdsh-plugingenerative-ailocal-firstmcpmotionmotion-graphicsmultimodalopenmotionreverse-engineeringvideo-editingvideo-generationworkbuddy
import { describe, expect, it } from "vitest";
import { timelineTrackOrder, trackDisplayNumber, trackDisplaySuffix } from "./timelineTrackDisplay";
describe("timelineTrackOrder", () => {
it("is the ascending distinct key order, fractional sub-comp keys included", () => {
const elements = [{ track: 1 }, { track: 0 }, { track: 1 / 6 }, { track: 1 }];
expect(timelineTrackOrder(elements)).toEqual([0, 1 / 6, 1]);
});
});
describe("trackDisplayNumber", () => {
it("is the key's 1-based row, not the fractional key itself", () => {
const order = timelineTrackOrder([{ track: 0 }, { track: 1 / 6 }, { track: 1 }]);
expect(trackDisplayNumber(order, 1 / 6)).toBe(2);
expect(trackDisplayNumber(order, 1)).toBe(3);
});
it("is null for a key with no row rather than a plausible-looking one", () => {
// The old end-row fallback announced "track 4" for a track the user cannot
// see at row 4, and nothing upstream could tell that apart from a real row.
expect(trackDisplayNumber([0, 1, 2], 7)).toBeNull();
});
});
describe("trackDisplaySuffix", () => {
it("names the row when there is one", () => {
expect(`Hide track${trackDisplaySuffix(3)}`).toBe("Hide track 3");
});
it("drops the number entirely when there is no row", () => {
expect(`Hide track${trackDisplaySuffix(null)}`).toBe("Hide track");
});
});