From 81055e14a18bf396ad014aa97ffc78997b267e26 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Thu, 12 Nov 2026 17:10:28 +0800 Subject: [PATCH] docs(tests): clarify workspace and legacy model test coverage --- tests/board-directory.test.mjs | 1 + tests/canvas-frames.test.mjs | 1 + tests/canvas-geometry.test.mjs | 1 + tests/canvas-style.test.mjs | 1 + tests/workspace.test.mjs | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/board-directory.test.mjs b/tests/board-directory.test.mjs index 50083e4..5116824 100644 --- a/tests/board-directory.test.mjs +++ b/tests/board-directory.test.mjs @@ -21,6 +21,7 @@ test('missing parents and corrupt cycles remain accessible without recursive loo const roots=boardDirectory([board('orphan','missing'),board('a','b'),board('b','a')]);assert.deepEqual(roots.map(item=>item.board.id),['orphan','a','b']);assert.ok(roots.every(item=>item.children.length===0)); }); // 非递增 next_offset 明确拒绝;已经 abort 的信号由请求替身抛回,加载器不得吞掉取消。 +// 取消样本在请求开始前触发,不验证分页中途取消或真实 fetch 是否停止下载。 test('directory rejects non-advancing pagination and propagates aborts',async()=>{ await assert.rejects(loadBoardDirectory(async()=>({items:[],next_offset:0}),'w'),/invalid_pagination/); const controller=new AbortController();controller.abort();await assert.rejects(loadBoardDirectory(async(_path,options)=>{options.signal.throwIfAborted();},'w',controller.signal),{name:'AbortError'}); diff --git a/tests/canvas-frames.test.mjs b/tests/canvas-frames.test.mjs index 2b4bc58..6a8fc0d 100644 --- a/tests/canvas-frames.test.mjs +++ b/tests/canvas-frames.test.mjs @@ -93,6 +93,7 @@ test("deleting a frame keeps its content and undo restores membership", () => { }); // hidden/fixed/scaled 标签、名称与 frameId 往返保存,frame 渲染层序为 -1,设置历史可撤销。 +// 此处核对模型字段,不挂载 FrameNode,也不证明缩放时屏幕字号/视觉层序已通过浏览器检查。 test("all label modes, frame names and memberships survive save/restore and settings undo", () => { const { frame, member, document } = seeded(); member.data.frameId = frame.id; diff --git a/tests/canvas-geometry.test.mjs b/tests/canvas-geometry.test.mjs index f886638..0f76748 100644 --- a/tests/canvas-geometry.test.mjs +++ b/tests/canvas-geometry.test.mjs @@ -35,6 +35,7 @@ test("card types inherit common element transforms and add branching; plain text }); // 五种旋转角度乘八方向 handle,检查受影响尺寸和相反局部锚点世界坐标保持不变。 +// 这是40组确定性样本,未模拟 DOM/CSS zoom 或实际指针捕获;失败定位以坐标不变量为准。 test("all eight handles resize cards while retaining the opposite local anchor, including rotated cards", () => { const directions = ["top", "right", "bottom", "left", "top-left", "top-right", "bottom-left", "bottom-right"]; for (const rotation of [0, 37, 90, 180, 270]) { diff --git a/tests/canvas-style.test.mjs b/tests/canvas-style.test.mjs index 280875a..593e58b 100644 --- a/tests/canvas-style.test.mjs +++ b/tests/canvas-style.test.mjs @@ -11,6 +11,7 @@ import { resizeFromPointer } from "../src/lib/canvas-geometry.ts"; function seeded() { return { ...emptyCanvas(), nodes: [makeCanvasNode("text", { x: 100, y: 200 })] }; } // 从同一父节点分别创建 text/script/image,检查连线端口、图片源、快照往返,再用一次 replace 历史整体撤销。 +// 图片只传符合字符串语法的 data URL,没有上传或图片解码;该断言不验证文件内容可显示。 test("branch type selection creates the chosen text, script or uploaded image and keeps the link in one undo step", () => { for (const kind of ["text", "script", "image"]) { const original = seeded(); diff --git a/tests/workspace.test.mjs b/tests/workspace.test.mjs index b542f77..b8db0a6 100644 --- a/tests/workspace.test.mjs +++ b/tests/workspace.test.mjs @@ -130,7 +130,7 @@ test("renaming reads the latest version and preserves description and content", assert.equal(renamed.version, 8); }); -// 空白或超过 100 字符的标题在请求前拒绝;用 assert.fail 确保没有任何 API 调用。 +// 空白和101个“字”(UTF-8共303字节)在请求前拒绝;这是300字节上限样本,不是任意文本100字符上限。 test("rename rejects empty or oversized names without any API calls", async () => { for (const name of [" ", "字".repeat(101)]) { await assert.rejects(renameBoard(() => assert.fail("unexpected API call"), "space", "board", name), /invalid_title/);