feat: 收口 tree-first graph 主链与前端测试修复

This commit is contained in:
lix-2026
2026-04-18 05:43:49 +08:00
parent d8de820d93
commit d3876e56eb
33 changed files with 2421 additions and 345 deletions
@@ -318,4 +318,48 @@ describe("buildSidebarInitialData", () => {
mediaAssets: [],
});
});
it("缺少 kernel projection 时不再本地补真相,而是返回空契约 projection", () => {
expect(
mapSidebarDatasetListQueryResultToInitialData({
active_workspace_id: "ws_1",
workspaces: [],
documents: [
{
id: "doc_1",
workspace_id: "ws_1",
title: "页面 1",
parent_id: null,
sort_order: 1,
is_starred: false,
access_scope: "private",
is_template: false,
created_at: "2026-04-14T00:00:00Z",
updated_at: null,
},
],
trashed_documents: [],
media_assets: [],
trashed_media_assets: [],
mindmap_assets: [],
trashed_mindmap_assets: [],
table_assets: [],
trashed_table_assets: [],
mindmap_docs: [],
mindmap_asset_children: {},
}),
).toMatchObject({
activeWorkspaceId: "ws_1",
kernelSidebarProjection: {
projectionId: "kernel_projection:sidebar_tree:missing",
items: [],
edges: [],
},
kernelSidebarTree: [
{
id: "doc_1",
},
],
});
});
});