docs(tests): clarify media fixtures and response timeout coverage
This commit is contained in:
@@ -10,6 +10,7 @@ import { resizeFromPointer } from "../src/lib/canvas-geometry.ts";
|
||||
import { iconCatalog, iconsById, searchIcons } from "../src/components/canvas/icon-catalog.ts";
|
||||
|
||||
// PlainImageElement 继承通用变换但不继承 CardElement,比例缩放、名称和 src 可恢复,重命名可撤销。
|
||||
// YQ== 只是单字节 a 的 data URL:用于来源字段往返,不是可解码图片;尺寸断言来自模型默认值。
|
||||
test("plain images inherit transforms without card connections and preserve source/name on restore", () => {
|
||||
const image = new PlainImageElement({ x: 0, y: 0 }, "", "data:image/png;base64,YQ==");
|
||||
assert(image instanceof CanvasElement); assert.equal(image instanceof CardElement, false);
|
||||
@@ -23,7 +24,8 @@ test("plain images inherit transforms without card connections and preserve sour
|
||||
assert.equal(canvasReducer(renamed, { type: "undo" }).present.nodes[0].data.title, "图片");
|
||||
});
|
||||
|
||||
// 纯图片不能作为卡片连线目标;删除连线后 javascript: src 仍必须被解码器拒绝。
|
||||
// emptyCanvas 的 schema 1 快照拒绝连向 plainImage 的旧卡片边;这不是 schema 2 的通用连线规则。
|
||||
// 两次断言分别隔离非法连线和非法来源:先保持有效 src 测边,再清空 edges 测 javascript: src。
|
||||
test("plain image sources are required and pure images cannot acquire card connections", () => {
|
||||
const image = makeCanvasNode("plain-image", { x: 0, y: 0 }, "data:image/png;base64,YQ==");
|
||||
const card = makeCanvasNode("text", { x: 300, y: 0 });
|
||||
@@ -33,7 +35,8 @@ test("plain image sources are required and pure images cannot acquire card conne
|
||||
assert.throws(() => decodeCanvas(JSON.stringify(document)));
|
||||
});
|
||||
|
||||
// 图标 ID 唯一并符合后端字符形状,中文类别与英文词可搜索;仅验证当前本地目录,不请求后端搜索。
|
||||
// 图标 ID 唯一并符合后端字符形状,中文类别与英文词可搜索;当前本地目录同时含 Lucide 和实验性 Tabler。
|
||||
// 数量下限与两个固定 slug 是回归样本,不证明上游图标库的每个版本都已完整收录,也不请求后端搜索。
|
||||
test("the complete Lucide catalog has unique backend-compatible identifiers and searchable names", () => {
|
||||
assert(iconCatalog.length > 2000);
|
||||
assert.equal(iconsById.size, iconCatalog.length);
|
||||
|
||||
Reference in New Issue
Block a user