JhHardwareWRS/scripts/test-material-stock-lot-wording.mjs
2026-06-24 15:19:14 +08:00

33 lines
1.3 KiB
JavaScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const userFacingFiles = [
"pages/reportForm/reportForm.wxml",
"pages/reportForm/reportForm.js",
"pages/dashboard/dashboard.wxml",
"pages/review/review.wxml",
"pages/records/records.wxml",
"utils/api.js"
];
const backendUserFacingFiles = [
"JhHardwareWRS_BackPoint/app/services/excel_export.py",
"JhHardwareWRS_BackPoint/app/routers/dashboard.py"
];
for (const file of userFacingFiles) {
const content = readFileSync(new URL(`../${file}`, import.meta.url), "utf8");
assert.ok(!content.includes("原材料分批次号"), `${file} 仍包含“原材料分批次号”`);
assert.ok(!content.includes("请选择工单号"), `${file} 仍包含“请选择工单号”`);
}
for (const file of backendUserFacingFiles) {
const content = readFileSync(new URL(`../../${file}`, import.meta.url), "utf8");
assert.ok(!content.includes("原材料分批次号"), `${file} 仍包含“原材料分批次号”`);
assert.ok(content.includes("材料库存批次号"), `${file} 缺少“材料库存批次号”`);
}
const reportForm = readFileSync(new URL("../pages/reportForm/reportForm.wxml", import.meta.url), "utf8");
assert.ok(reportForm.includes("材料库存批次号"));
console.log("material stock lot wording checks passed");