优化运行轨迹关联名称展示
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 功能:验证工作人员关联字段过滤、资质来源校验和路由上下文传递契约。
|
||||
* 版本:v1.2.0
|
||||
* 版本:v1.3.0
|
||||
*/
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
@@ -105,8 +105,17 @@ const resourcesSource = await readFile(
|
||||
assert.match(resourcesSource, /organizationScoped: true/);
|
||||
assert.equal(
|
||||
(resourcesSource.match(/staffRelation:/g) ?? []).length,
|
||||
3,
|
||||
'三个工作人员关联场景都必须显式声明策略',
|
||||
4,
|
||||
'四个工作人员关联场景都必须显式声明策略',
|
||||
);
|
||||
const trackPolicy = resourcesSource.match(
|
||||
/define\('gasorder_track',[\s\S]*?staffRelation: \{ roles: \['delivery'\] \}[\s\S]*?\n\s*\]\),/,
|
||||
)?.[0];
|
||||
assert.ok(trackPolicy, '运行轨迹必须显式限定配送人员岗位');
|
||||
assert.doesNotMatch(
|
||||
trackPolicy,
|
||||
/enabledOnly|workStatus|validCredentialOnly/,
|
||||
'历史运行轨迹不得按人员当前启用、在岗或资质状态过滤',
|
||||
);
|
||||
|
||||
const relationsSource = await readFile(
|
||||
|
||||
Reference in New Issue
Block a user