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.ts index 589659481f..3dc9acb7d5 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.ts index 69d697a357..5ddf382a82 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', () => {