feat: cut over rust web main shell
This commit is contained in:
@@ -214,7 +214,11 @@ describe("documents route adapters", () => {
|
||||
|
||||
const response = await postTitle(new Request("http://localhost/api/documents/title", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
headers: {
|
||||
"authorization": "Bearer test-token",
|
||||
"content-type": "application/json",
|
||||
"cookie": "convex-auth=test-cookie",
|
||||
},
|
||||
body: JSON.stringify({ documentId: "doc_1", workspaceId: "ws_1", title: "新标题" }),
|
||||
}));
|
||||
const payload = await response.json() as {
|
||||
@@ -235,6 +239,15 @@ describe("documents route adapters", () => {
|
||||
}),
|
||||
}),
|
||||
);
|
||||
const renameCall = fetchMock.mock.calls.find(([, init]) => {
|
||||
if (!init || typeof init.body !== "string") {
|
||||
return false;
|
||||
}
|
||||
return init.body.includes('"action":"rename"');
|
||||
});
|
||||
const forwardedHeaders = renameCall?.[1]?.headers as Headers;
|
||||
expect(forwardedHeaders.get("authorization")).toBe("Bearer test-token");
|
||||
expect(forwardedHeaders.get("cookie")).toBe("convex-auth=test-cookie");
|
||||
expect(payload.ok).toBe(true);
|
||||
expect(payload.meta.commandName).toBe("tree.node.rename");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user