test: resolve planning Company from Yacimientos

This commit is contained in:
2026-09-11 01:16:39 -03:00
parent 6e0adb7a07
commit 4d7f5f7df4
@@ -7,7 +7,7 @@ function source(path: string): string {
return readFileSync(resolve(process.cwd(), path), 'utf8'); return readFileSync(resolve(process.cwd(), path), 'utf8');
} }
test('F6.1 planning preloads the local start time and resolves the Area operator immediately', () => { test('F6.1 planning preloads the local start time and resolves Companies projected by Yacimientos', () => {
const page = source('../web-v2/src/pages/InspectionVisitCreateF61Page.tsx'); const page = source('../web-v2/src/pages/InspectionVisitCreateF61Page.tsx');
const hierarchy = source('src/inspection-visits/inspection-planning-hierarchy.service.ts'); const hierarchy = source('src/inspection-visits/inspection-planning-hierarchy.service.ts');
@@ -17,9 +17,9 @@ test('F6.1 planning preloads the local start time and resolves the Area operator
assert.match(page, /response\.data\.length === 1/); assert.match(page, /response\.data\.length === 1/);
assert.match(page, /setOperatorId\(response\.data\[0\]\.id\)/); assert.match(page, /setOperatorId\(response\.data\[0\]\.id\)/);
assert.match(page, /Sin Operadora vigente para esa fecha/); assert.match(page, /Sin Operadora vigente para esa fecha/);
assert.match(hierarchy, /relation\.relation_role='OPERATOR'/); assert.match(hierarchy, /FROM assets yacimiento/);
assert.match(hierarchy, /relation\.valid_from <= \$2::timestamptz/); assert.match(hierarchy, /yacimiento\.operator_company_id/);
assert.match(hierarchy, /relation\.valid_until IS NULL OR relation\.valid_until > \$2::timestamptz/); assert.match(hierarchy, /SELECT DISTINCT company\.id/);
}); });
test('F6.1 WEB cancellation requires an explicit audited reason and is available while in progress', () => { test('F6.1 WEB cancellation requires an explicit audited reason and is available while in progress', () => {