From 35bc4f094a0bb592f5d87c78ace32c254c542034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 1 Dec 2026 11:07:46 +0100 Subject: [PATCH] Consent version test: no direct buildConfig import (testConfig guard) Co-Authored-By: Claude Opus 5.5 --- test/policyVersionRising.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/policyVersionRising.test.ts b/test/policyVersionRising.test.ts index a1e5b26..936c03a 100644 --- a/test/policyVersionRising.test.ts +++ b/test/policyVersionRising.test.ts @@ -96,10 +96,8 @@ describe('cookieSettings: { allowLowerPolicyVersion: true } keeps the old behavi }) test('iapl() passes the option through', async () => { - const { buildConfig } = await import('payload') const { policyVersionNeverDown } = await import('../src/globals/CookieSettings/fields.js') const config = await iapl({ cookieSettings: { allowLowerPolicyVersion: true }, i18n: { defaultLocale: 'en', locales: [{ code: 'en', label: 'English' }] }, mail: { relay: false }, twoFactor: false })({ collections: [], secret: 'x' } as never) - void buildConfig const g = config.globals!.find((x) => x.slug === 'cookie-settings') as { fields: { hooks?: { beforeValidate?: unknown[] }; name?: string }[] } expect(g.fields.find((f) => f.name === 'policyVersion')?.hooks?.beforeValidate ?? []).not.toContain(policyVersionNeverDown) })