修复企微通讯录生产导入兼容性(07-26-internal-ops-recovery-baseline)
这个提交包含在:
@@ -1,3 +1,4 @@
|
||||
const fs = require("node:fs");
|
||||
const ExcelJS = require("exceljs");
|
||||
|
||||
const {
|
||||
@@ -5,6 +6,7 @@ const {
|
||||
buildSafeReport,
|
||||
parseArgs,
|
||||
parseDirectoryExport,
|
||||
readStdinBuffer,
|
||||
} = require("../../../src/scripts/import-wecom-directory-export");
|
||||
|
||||
async function buildDirectoryWorkbook(rows) {
|
||||
@@ -39,6 +41,17 @@ async function buildDirectoryWorkbook(rows) {
|
||||
}
|
||||
|
||||
describe("WeCom directory export importer", () => {
|
||||
it("reads stdin through the fd-compatible synchronous API", () => {
|
||||
const expected = Buffer.from("synthetic-xlsx");
|
||||
const readFileSync = vi.spyOn(fs, "readFileSync").mockReturnValue(expected);
|
||||
try {
|
||||
expect(readStdinBuffer()).toBe(expected);
|
||||
expect(readFileSync).toHaveBeenCalledWith(0);
|
||||
} finally {
|
||||
readFileSync.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("requires stdin, the apply environment gate, and an actor for apply", () => {
|
||||
const previous = process.env.WECOM_DIRECTORY_EXPORT_APPLY;
|
||||
delete process.env.WECOM_DIRECTORY_EXPORT_APPLY;
|
||||
|
||||
在新工单中引用
屏蔽一个用户