fix(story): harden notebook interaction and fallback

This commit is contained in:
Evandro Fonseca Junior committed 2026-08-31 01:28:43 -03:00
1 parent bb4bf8e7e2
commit f3ed9da777
12 files changed
+344 -57

No files matched your search

+13 -2
View File
@@ -64,8 +64,8 @@ describe("getNotebookFrame", () => {
});
it("emits a deterministic cursor click pulse for each tab", () => {
const first = getNotebookFrame(0.447, 4);
const later = getNotebookFrame(0.53, 4);
const first = getNotebookFrame(0.475, 4);
const later = getNotebookFrame(0.56, 4);
expect(first.cursorClicking).toBe(true);
expect(later.cursorClicking).toBe(true);
@@ -75,6 +75,17 @@ describe("getNotebookFrame", () => {
expect(first.cursorY).toBeLessThanOrEqual(1);
});
it("moves the cursor between tab targets instead of teleporting", () => {
const previous = getNotebookFrame(0.525, 4);
const moving = getNotebookFrame(0.532, 4);
const target = getNotebookFrame(0.56, 4);
expect(moving.cursorX).toBeGreaterThan(previous.cursorX);
expect(moving.cursorX).toBeLessThan(target.cursorX);
expect(moving.cursorY).toBeLessThan(previous.cursorY);
expect(moving.cursorY).toBeGreaterThan(target.cursorY);
});
it("is deterministic when rewound to the same progress", () => {
expect(getNotebookFrame(0.61, 4)).toEqual(getNotebookFrame(0.61, 4));
});