修复四项新版开单和恢复差异,核验三项已确认行为
This commit is contained in:
1 parent
fdaa6afad5
commit
c29ea45ec4
25 files changed
+617
-171
No files matched your search
@@ -321,18 +321,50 @@ try {
|
||||
continue;
|
||||
}
|
||||
const [old, next] = results.map(rs => rs.value);
|
||||
const diffs = compare(old.result, next.result);
|
||||
const raw = compare(old.result, next.result);
|
||||
let expected = old.result;
|
||||
let control;
|
||||
if (!old.failure && !next.failure) {
|
||||
if (['issue', 'issue-pool-date', 'issue-reopen'].includes(group)) {
|
||||
const { expectedIssueResult } = await import('./writes/issue-contract.mjs');
|
||||
if (group === 'issue-pool-date') {
|
||||
// 同一固定旧版、相同初始库存与成本。显式选择订单日料池,
|
||||
// 由真实业务事务产生新版的预期账本,不在比对器里重算成本或忽略账表。
|
||||
control = await run(browser, group, ctx => scenario({ ...ctx, selectOrderDatePool: true }), 'old');
|
||||
assert.ok(!control.failure, '显式选择订单日料池的旧版对照失败:' + control.failure);
|
||||
}
|
||||
expected = expectedIssueResult(group, old.result, control?.result);
|
||||
} else if (group === 'funds' || group === 'funds-transfer') {
|
||||
// 双方页面已各自断言历史单数地址的反馈,只调整已批准的两项期望值。
|
||||
expected = structuredClone(old.result);
|
||||
const singular = expected.feedback.历史团队转账反馈.transfer;
|
||||
singular.toast = '原操作已确认';
|
||||
singular.orderReads = [];
|
||||
}
|
||||
}
|
||||
const diffs = expected === old.result ? raw : compare(expected, next.result);
|
||||
const approved = expected === old.result ? [] : compare(old.result, expected).diffs;
|
||||
console.log(
|
||||
group,
|
||||
Object.keys(old.result.steps).length + ' 步',
|
||||
old.hits.length + '/' + next.hits.length + ' 次 POST',
|
||||
diffs.diffs.length + ' 处差异',
|
||||
diffs.diffs.length + ' 处未预期差异,' + approved.length + ' 处已确认字段差异',
|
||||
);
|
||||
outcomes[group] = {
|
||||
readOnly: { old: old.verifiedReads, new: next.verifiedReads },
|
||||
steps: { old: Object.keys(old.result.steps), new: Object.keys(next.result.steps) },
|
||||
failures: { old: old.failure, new: next.failure },
|
||||
diffs: diffs.diffs,
|
||||
...(control
|
||||
? {
|
||||
legacyOrderDateControl: {
|
||||
reference,
|
||||
steps: Object.keys(control.result.steps),
|
||||
hits: control.hits.length,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(approved.length ? { approved, rawDiffs: raw.diffs } : {}),
|
||||
};
|
||||
for (const [side, rs] of [
|
||||
['old', old],
|
||||
|
||||
Reference in new issue
Block a user