test: 建立 DOCX 自动化验收门禁

This commit is contained in:
SkyJourney
2026-07-30 16:48:41 +08:00
parent f2dfc6ef72
commit aff2830c28
15 changed files with 1452 additions and 12 deletions
@@ -52,6 +52,7 @@ import {
toDesktopDocxExportFailure,
type DesktopDocxExportOutcome
} from "./docx-contract.js";
import { saveDesktopDocx } from "./desktop-docx-save.js";
import { ElectronDocxMediaEngine } from "./electron-docx-media-engine.js";
import {
parseMarkdownRenderRequest,
@@ -987,16 +988,14 @@ export class DesktopApplicationController {
timings: generated.timings
};
}
const targetPath = selection.filePath
.toLowerCase()
.endsWith(".docx")
? selection.filePath
: `${selection.filePath}.docx`;
await writeFile(targetPath, generated.docx);
const saved = await saveDesktopDocx(
selection.filePath,
generated.docx
);
return {
ok: true,
saved: true,
fileName: path.basename(targetPath),
fileName: saved.fileName,
diagnostics: generated.diagnostics,
timings: generated.timings
};