docs(tests): clarify workspace and legacy model test coverage

This commit is contained in:
2026-11-12 17:10:28 +08:00
parent c735c00de8
commit 81055e14a1
5 changed files with 5 additions and 1 deletions
+1
View File
@@ -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'});
+1
View File
@@ -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;
+1
View File
@@ -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]) {
+1
View File
@@ -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();
+1 -1
View File
@@ -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/);