Consent version test: no direct buildConfig import (testConfig guard)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
27ddbc3b41
commit
35bc4f094a
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user