test(f6.1): cover pre-merge operator consistency blockers

This commit is contained in:
2026-09-09 17:27:48 -03:00
parent 257ee20148
commit f93e8240ad
@@ -75,12 +75,25 @@ test('F6.1 historical operational lists read Company and Area from the parent In
assert.doesNotMatch(reports, /context_asset\.operator_company_id/);
});
test('F6.1 WEB keeps operator selection at creation and removes it from Inventory edits', () => {
test('F6.1 WEB Inventory searches use physical Area and never the operator snapshot filter', () => {
const inspectionEditor = source('../web-v2/src/pages/InspectionVisitEditorF4Page.tsx');
const fieldDiscoveries = source('../web-v2/src/pages/FieldDiscoveriesPage.tsx');
for (const page of [inspectionEditor, fieldDiscoveries]) {
assert.match(page, /listAssets\(\{[\s\S]{0,250}operationalAreaId:/);
assert.doesNotMatch(page, /listAssets\(\{[\s\S]{0,250}operatorCompanyId:/);
}
});
test('F6.1 WEB derives the creation snapshot from the active Area operator and removes it from Inventory edits', () => {
const editor = source('../web-v2/src/pages/AssetEditorPage.tsx');
const contextPanel = source('../web-v2/src/features/assets/AssetContextHistoryPanel.tsx');
assert.match(editor, /createAsset\(\{[\s\S]*operatorCompanyId: operatorCompanyId \|\| null/);
assert.doesNotMatch(editor, /updateAsset\(id, \{[^}]*operatorCompanyId/);
assert.doesNotMatch(editor, /parent\.operatorCompany/);
assert.match(editor, /listCompaniesForArea\(operationalAreaId\)\.then\(\(loadedCompanies\)/);
assert.match(editor, /loadedCompanies\.length === 1 \? loadedCompanies\[0\]\.id : ''/);
assert.match(editor, /Snapshot histórico de alta/);
assert.match(contextPanel, /Cambiar contexto físico/);
assert.doesNotMatch(contextPanel, /operatorCompanyId:/);