WREAD1F 生成企微审批可读性新样例
这个提交包含在:
@@ -139,8 +139,14 @@ function targetLabel(targetKey) {
|
||||
return APPROVAL_POC_TARGETS.find((item) => item.key === targetKey)?.label || targetKey;
|
||||
}
|
||||
|
||||
function fixtureTimestamp(generatedAt) {
|
||||
return generatedAt
|
||||
.replace(/[-:]/g, "")
|
||||
.replace(/\.\d{3}Z$/, "Z");
|
||||
}
|
||||
|
||||
function fixtureNumber(targetKey, generatedAt) {
|
||||
return `WAPC2F-${targetKey}-${generatedAt.slice(0, 10).replace(/-/g, "")}`;
|
||||
return `WAPC2F-${targetKey}-${fixtureTimestamp(generatedAt)}`;
|
||||
}
|
||||
|
||||
function fixtureControlIds() {
|
||||
@@ -175,7 +181,7 @@ function buildTemplateFixturePayload(target, generatedAt) {
|
||||
const number = fixtureNumber(target.key, generatedAt);
|
||||
const controlIds = fixtureControlIds();
|
||||
return {
|
||||
template_name: localized(`OA-POC-${label}-${generatedAt.slice(0, 10)}`),
|
||||
template_name: localized(`OA-POC-${label}-${fixtureTimestamp(generatedAt)}`),
|
||||
template_content: {
|
||||
controls: [
|
||||
buildTemplateControl("Text", controlIds.type, "类型", { require: true }),
|
||||
|
||||
@@ -131,7 +131,7 @@ describe("check-wecom-approval-fixtures", () => {
|
||||
);
|
||||
|
||||
expect(payload.template_names).toBeUndefined();
|
||||
expect(payload.template_name).toEqual([{ text: "OA-POC-请假-2026-05-19", lang: "zh_CN" }]);
|
||||
expect(payload.template_name).toEqual([{ text: "OA-POC-请假-20260519T100000Z", lang: "zh_CN" }]);
|
||||
expect(payload.template_content.controls).toHaveLength(3);
|
||||
expect(payload.template_content.controls[0]).toMatchObject({
|
||||
property: {
|
||||
|
||||
在新工单中引用
屏蔽一个用户