From 6be570fc55dc09d110d3a3ebc5ecc858ffbd5e13 Mon Sep 17 00:00:00 2001 From: Simon Orzel Date: Tue, 28 Jul 2026 23:03:53 +0200 Subject: [PATCH 1/3] =?UTF-8?q?feat(e2e):=20all=20nine=20custom=20editors?= =?UTF-8?q?=20=E2=80=94=20SQL-verified=20config=20round-trips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last big coverage block: every bespoke editor driven through its real UI with persistence asserted in Postgres and re-rendered after reload. - Five PolicyEditorShell editors (patch 6.4, crypto 9.1, access control 10.1, procurement 6.1, secure dev 6.2): edit, change distinctive values (SLA hours, key rotation, access model + review frequencies, threshold + clause toggle, SDLC/hardening selects + segregation), save via the shared shell, assert the JSONB config keys. - Risk methodology 2.1: name + acceptance threshold into company_risk_methodology. - Asset and supplier risk registers 2.3/5.3: inline risk creation with the matrix picker (score 16), chained create+link mutations, join-table asserts against seeded assets/suppliers. - Risk treatment 2.4: add measure, set residual via matrix, accept risk; asserts accepted_at, residual score and the treatment row. Product hooks: ~25 data-testid attributes across 11 components, chosen from a 4-agent mapping pass that flagged exactly which selectors were silent-failure risks (twin selects, locale-dependent row labels, shared shell buttons covering five editors with three testids). Suite: 76 passed + 1 documented skip; 110 L0; typecheck clean. Coverage: 45/49 requirements primary-surface tested; untouched list is now only 1.2 (team) and 5.2 (supplier contract), both awaiting the invite-flow specs. --- components/compliance/AccessControlEditor.tsx | 6 +- components/compliance/CryptoPolicyEditor.tsx | 1 + components/compliance/PatchPolicyEditor.tsx | 2 + components/compliance/PolicyEditorShell.tsx | 6 +- components/compliance/ProcurementEditor.tsx | 2 + .../compliance/RiskMethodologyEditor.tsx | 6 +- components/compliance/SecureDevEditor.tsx | 5 +- components/risks/AssetRiskRegister.tsx | 4 +- components/risks/RiskMatrixPicker.tsx | 1 + components/risks/RiskTreatmentView.tsx | 9 +- components/suppliers/SupplierRiskRegister.tsx | 4 +- e2e/coverage-report.ts | 6 +- e2e/l2/editors.spec.ts | 226 ++++++++++++++++++ 13 files changed, 262 insertions(+), 16 deletions(-) create mode 100644 e2e/l2/editors.spec.ts diff --git a/components/compliance/AccessControlEditor.tsx b/components/compliance/AccessControlEditor.tsx index 1b17d05..5353ed6 100644 --- a/components/compliance/AccessControlEditor.tsx +++ b/components/compliance/AccessControlEditor.tsx @@ -43,7 +43,7 @@ export function AccessControlEditor({ disabled, guidance, initialData }: { disab onValueChange={(v) => draft && setDraft({ ...draft, model: v as "rbac" | "abac" | "hybrid" })} disabled={fieldsDisabled} > - + {tc("rbac")} {tc("abac")} @@ -60,6 +60,7 @@ export function AccessControlEditor({ disabled, guidance, initialData }: { disab
draft && setDraft({ @@ -74,6 +75,7 @@ export function AccessControlEditor({ disabled, guidance, initialData }: { disab
draft && setDraft({ @@ -111,7 +113,7 @@ export function AccessControlEditor({ disabled, guidance, initialData }: { disab onValueChange={(v) => draft && setDraft({ ...draft, sharedAccountPolicy: v as "prohibited" | "documented_exceptions" })} disabled={fieldsDisabled} > - + {tc("sharedProhibited")} {tc("sharedDocumentedExceptions")} diff --git a/components/compliance/CryptoPolicyEditor.tsx b/components/compliance/CryptoPolicyEditor.tsx index 538241d..0fdd29b 100644 --- a/components/compliance/CryptoPolicyEditor.tsx +++ b/components/compliance/CryptoPolicyEditor.tsx @@ -197,6 +197,7 @@ export function CryptoPolicyEditor({ disabled, guidance, initialData }: { disabl {tc("reviewCycle")} - -
) : ( - diff --git a/components/compliance/ProcurementEditor.tsx b/components/compliance/ProcurementEditor.tsx index bb7e2d9..232b894 100644 --- a/components/compliance/ProcurementEditor.tsx +++ b/components/compliance/ProcurementEditor.tsx @@ -47,6 +47,7 @@ export function ProcurementEditor({ disabled, guidance, initialData }: { disable draft && setDraft({ ...draft, thresholdEur: Number(e.target.value) || 0 })} @@ -63,6 +64,7 @@ export function ProcurementEditor({ disabled, guidance, initialData }: { disable {CLAUSE_KEYS.map((key) => (
draft && setDraft({ diff --git a/components/compliance/RiskMethodologyEditor.tsx b/components/compliance/RiskMethodologyEditor.tsx index 204815b..f9d07c8 100644 --- a/components/compliance/RiskMethodologyEditor.tsx +++ b/components/compliance/RiskMethodologyEditor.tsx @@ -315,6 +315,7 @@ export function RiskMethodologyEditor({
) : ( - @@ -340,6 +341,7 @@ export function RiskMethodologyEditor({ setName(e.target.value)} disabled={fieldsDisabled} @@ -390,7 +392,7 @@ export function RiskMethodologyEditor({ onValueChange={(v) => setAcceptanceThreshold(Number(v))} disabled={fieldsDisabled} > - + diff --git a/components/compliance/SecureDevEditor.tsx b/components/compliance/SecureDevEditor.tsx index 59d8dd7..81a1267 100644 --- a/components/compliance/SecureDevEditor.tsx +++ b/components/compliance/SecureDevEditor.tsx @@ -51,7 +51,7 @@ export function SecureDevEditor({ disabled, guidance, initialData }: { disabled? } disabled={fieldsDisabled} > - + {tc("owaspSamm")} {tc("bsimm")} @@ -70,7 +70,7 @@ export function SecureDevEditor({ disabled, guidance, initialData }: { disabled? } disabled={fieldsDisabled} > - + {tc("cis")} {tc("bsi")} @@ -108,6 +108,7 @@ export function SecureDevEditor({ disabled, guidance, initialData }: { disabled? {/* Environment Segregation — CIR 6(2) */}
draft && setDraft({ ...draft, environmentSegregation: !!v }) diff --git a/components/risks/AssetRiskRegister.tsx b/components/risks/AssetRiskRegister.tsx index a7c061d..3e1fc59 100644 --- a/components/risks/AssetRiskRegister.tsx +++ b/components/risks/AssetRiskRegister.tsx @@ -168,6 +168,7 @@ export function AssetRiskRegister({ initialData, disabled }: AssetRiskRegisterPr @@ -213,7 +213,7 @@ export function RiskTreatmentView({ initialData, disabled }: RiskTreatmentViewPr
) : ( - )} @@ -223,6 +223,7 @@ export function RiskTreatmentView({ initialData, disabled }: RiskTreatmentViewPr {residualBelow && !risk.acceptedAt && !disabled && ( -
diff --git a/components/suppliers/SupplierRiskRegister.tsx b/components/suppliers/SupplierRiskRegister.tsx index 0dc78da..4fbc37f 100644 --- a/components/suppliers/SupplierRiskRegister.tsx +++ b/components/suppliers/SupplierRiskRegister.tsx @@ -169,6 +169,7 @@ export function SupplierRiskRegister({ initialData, disabled }: SupplierRiskRegi