test(f4): align legacy contracts with lifecycle model
This commit is contained in:
@@ -11,15 +11,15 @@ function policyCalls(value: string): number {
|
||||
return value.match(/assertMobileInspector\(principal\);/g)?.length ?? 0;
|
||||
}
|
||||
|
||||
test('D5.1 applies the mobile-inspector policy to every field operation', async () => {
|
||||
const [visits, acts, findings, evidence, closing] = await Promise.all([
|
||||
source('inspection-visits/inspection-visits.service.ts'),
|
||||
test('D5.1/F4 applies the mobile-inspector policy to every field operation', async () => {
|
||||
const [lifecycle, acts, findings, evidence, closing] = await Promise.all([
|
||||
source('inspection-visits/inspection-visit-lifecycle.service.ts'),
|
||||
source('inspection-acts/inspection-acts.service.ts'),
|
||||
source('inspection-findings/inspection-findings.service.ts'),
|
||||
source('inspection-findings/inspection-evidence.service.ts'),
|
||||
source('inspection-closing/inspection-closing.service.ts'),
|
||||
]);
|
||||
assert.equal(policyCalls(visits), 2);
|
||||
assert.equal(policyCalls(lifecycle), 2);
|
||||
assert.equal(policyCalls(acts), 3);
|
||||
assert.equal(policyCalls(findings), 2);
|
||||
assert.equal(policyCalls(evidence), 1);
|
||||
@@ -34,9 +34,7 @@ test('D5.1 leaves company follow-up outside the field-operation gate', async ()
|
||||
});
|
||||
|
||||
test('D5.1 migration grants operational permissions only to inspector', async () => {
|
||||
const migration = await source(
|
||||
'database/migrations/1787331600000-phase-d5-1-mobile-inspection-policy.ts',
|
||||
);
|
||||
const migration = await source('database/migrations/1787331600000-phase-d5-1-mobile-inspection-policy.ts');
|
||||
assert.match(migration, /role\.code <> 'inspector'/);
|
||||
assert.match(migration, /role\.code = 'inspector'/);
|
||||
assert.doesNotMatch(migration, /inspection_findings\.follow_up/);
|
||||
|
||||
Reference in New Issue
Block a user