Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
import * as NodeAssert from "node:assert/strict";
import { describe, it } from "vite-plus/test";
import { pickMostVisibleDemo } from "./demoPlayback";
describe("landing demo playback", () => {
it("plays only the most visible demo", () => {
NodeAssert.equal(pickMostVisibleDemo([0.2, 0.8, 0.4]), 1);
NodeAssert.equal(pickMostVisibleDemo([0, 0, 0]), null);
});
it("keeps the first demo when visibility is tied", () => {
NodeAssert.equal(pickMostVisibleDemo([0.6, 0.6, 0.2]), 0);
});
it("selects a demo as soon as any part enters the viewport", () => {
NodeAssert.equal(pickMostVisibleDemo([0, Number.MIN_VALUE, 0]), 1);
});
});