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) })