Implement Rust web sidebar title and tree interactions
This commit is contained in:
@@ -96,6 +96,11 @@ async function readText(baseUrl, path, init) {
|
||||
const text = await response.text();
|
||||
assert.equal(response.status, 200, `${path} 请求失败: ${response.status} ${text.slice(0, 200)}`);
|
||||
assert.equal(response.headers.get("x-mnote-web-owner"), "mnote-web", `${path} 缺少 mnote-web owner`);
|
||||
assert.equal(
|
||||
response.headers.get("x-mnote-legacy-upstream"),
|
||||
null,
|
||||
`${path} 默认主路径不应出现 Next fallback header`,
|
||||
);
|
||||
return { response, text };
|
||||
}
|
||||
|
||||
@@ -116,6 +121,10 @@ async function validateSkipNextRuntimePlan() {
|
||||
}
|
||||
|
||||
async function validateCoreShellsWithoutNext(baseUrl) {
|
||||
const root = await readText(baseUrl, "/?workspaceId=ws_demo");
|
||||
assert.match(root.text, /data-mnote-shell="workspace"/);
|
||||
assert.doesNotMatch(root.text, /next-app-router/i);
|
||||
|
||||
const auth = await readText(baseUrl, "/auth");
|
||||
assert.match(auth.text, /data-mnote-shell="auth"/);
|
||||
assert.doesNotMatch(auth.text, /next-app-router/i);
|
||||
@@ -134,6 +143,11 @@ async function validateCoreShellsWithoutNext(baseUrl) {
|
||||
const search = await readText(baseUrl, "/search?workspaceId=ws_demo&q=Rust");
|
||||
assert.equal(search.response.headers.get("x-mnote-web-shell"), "search");
|
||||
assert.match(search.text, /mnote\.search_shell\.v1/);
|
||||
|
||||
const mindmap = await readText(baseUrl, "/mindmap/doc_1/mind_1");
|
||||
assert.equal(mindmap.response.headers.get("x-mnote-web-shell"), "mindmap");
|
||||
assert.match(mindmap.text, /mnote\.mindmap_shell\.v1/);
|
||||
assert.doesNotMatch(mindmap.text, /next-app-router/i);
|
||||
}
|
||||
|
||||
async function validateDocs() {
|
||||
|
||||
Reference in New Issue
Block a user