Type municipalities e2e consent fixture with Payload

Replace the `Function`-typed payload param (no-unsafe-function-type lint error
blocking pre-push) with `Pick<Payload, 'find' | 'create'>`, which also surfaced
missing Lexical `version` fields in the consent fixture — now added.
This commit is contained in:
Francisco Ignácio Fontoura Solla 2026-07-23 21:39:14 -03:00
parent e2724c10da
commit 3b2e99ac40

View file

@ -1,3 +1,5 @@
import type { Payload } from 'payload'
import { SUPPORTER_REGISTRATION_CONSENT_KEY } from '../../src/utilities/campaignConsent.js' import { SUPPORTER_REGISTRATION_CONSENT_KEY } from '../../src/utilities/campaignConsent.js'
import { expect, test } from './fixtures/campaignE2EFixtures.js' import { expect, test } from './fixtures/campaignE2EFixtures.js'
@ -8,7 +10,7 @@ import { expect, test } from './fixtures/campaignE2EFixtures.js'
*/ */
const ensureSupporterRegistrationConsent = async (campaign: { const ensureSupporterRegistrationConsent = async (campaign: {
payload: { find: Function; create: Function } payload: Pick<Payload, 'find' | 'create'>
}) => { }) => {
const existing = await campaign.payload.find({ const existing = await campaign.payload.find({
collection: 'consent', collection: 'consent',
@ -29,7 +31,14 @@ const ensureSupporterRegistrationConsent = async (campaign: {
children: [ children: [
{ {
type: 'paragraph', type: 'paragraph',
children: [{ type: 'text', text: 'Consentimento de cadastro de apoiador (E2E).' }], version: 1,
children: [
{
type: 'text',
version: 1,
text: 'Consentimento de cadastro de apoiador (E2E).',
},
],
}, },
], ],
direction: 'ltr', direction: 'ltr',