功能(文档与桌面):完善文件预览下载与客户端构建基线
- 保存文档版本原始文件名,规范下载响应并持久化上传目录\n- 增加 PDF.js 预览、桌面保存打开流程及统一错误反馈\n- 统一 Node.js 22.13 构建基线并收紧临时文件权限门禁\n- 补充迁移、单元测试、发布检查与运维文档
This commit is contained in:
@@ -80,6 +80,16 @@ describe("file task feedback", () => {
|
||||
expect(messageSuccessMock).toHaveBeenCalledWith("文件下载已开始");
|
||||
});
|
||||
|
||||
it("writes to a destination that was selected before the download", async () => {
|
||||
const destination = { kind: "web-file-handle", handle: { createWritable: vi.fn() } } as const;
|
||||
const { saveFileWithFeedback } = await import("./fileTaskFeedback");
|
||||
|
||||
await expect(saveFileWithFeedback(output, {}, destination)).resolves.toBe("saved");
|
||||
|
||||
expect(saveFileMock).toHaveBeenCalledWith(output, destination);
|
||||
expect(messageSuccessMock).toHaveBeenCalledWith("文件已保存");
|
||||
});
|
||||
|
||||
it("uses persistent desktop activity for native save flows", async () => {
|
||||
capabilitiesMock.mockReturnValue({ nativeFiles: true });
|
||||
const { saveFileWithFeedback } = await import("./fileTaskFeedback");
|
||||
|
||||
Reference in New Issue
Block a user