The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
test(server): fix DPA Annex C test broken by sub-processor sync action (#22422)
Félix Malfait7b5d313dd1ee
diff --git a/packages/twenty-server/src/engine/core-modules/dpa/__tests__/subprocessors-json.spec.ts b/packages/twenty-server/src/engine/core-modules/dpa/__tests__/subprocessors-json.spec.tsindex 589659481f7..3dc9acb7d53 100644--- a/packages/twenty-server/src/engine/core-modules/dpa/__tests__/subprocessors-json.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/dpa/__tests__/subprocessors-json.spec.ts@@ -17,9 +17,16 @@ describe('subprocessors.json integrity', () => {expect(subprocessor.services.length).toBeGreaterThan(0);expect(Array.isArray(subprocessor.processingLocations)).toBe(true);- expect(subprocessor.processingLocations.length).toBeGreaterThan(0);expect(typeof subprocessor.processesPii).toBe('boolean');++ // A sub-processor that handles PII must declare where it does so (Annex C+ // relies on it). Non-PII providers (e.g. optional AI backends) may list+ // none, and the trust-center sync action owns this data, so the location+ // requirement is enforced only for PII processors.+ if (subprocessor.processesPii) {+ expect(subprocessor.processingLocations.length).toBeGreaterThan(0);+ }}});diff --git a/packages/twenty-server/src/engine/core-modules/dpa/utils/__tests__/resolve-dpa.util.spec.ts b/packages/twenty-server/src/engine/core-modules/dpa/utils/__tests__/resolve-dpa.util.spec.tsindex 69d697a3577..5ddf382a82d 100644--- a/packages/twenty-server/src/engine/core-modules/dpa/utils/__tests__/resolve-dpa.util.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/dpa/utils/__tests__/resolve-dpa.util.spec.ts@@ -219,13 +219,22 @@ describe('resolveDpa', () => {it('renders Annex C with one entry per synced sub-processor and ties it to §6.1', () => {const text = resolvedText(DpaRegion.EU, 'signed');+ const { subprocessors } = subprocessorsData as SubprocessorList;expect(text).toContain('ANNEX C – List of Sub-Processors');expect(text).toContain('set out in Annex C');- expect(text).toContain(- 'Amazon Web Services (https://aws.amazon.com) — Processing location(s): United States, Germany, France.',- );- expect(text).toContain('Anthropic');++ // Derive the expected entries from the synced data rather than hardcoding+ // vendor locations, which the trust-center sync action overwrites.+ for (const subprocessor of subprocessors) {+ const vendorSuffix = subprocessor.vendorUrl+ ? ` (${subprocessor.vendorUrl})`+ : '';++ expect(text).toContain(+ `${subprocessor.name}${vendorSuffix} — Processing location(s):`,+ );+ }});it('expands the sub-processor sentinel into exactly the synced entries', () => {