mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 14:55:16 +00:00
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:
parent
e2724c10da
commit
3b2e99ac40
1 changed files with 11 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import type { Payload } from 'payload'
|
||||
|
||||
import { SUPPORTER_REGISTRATION_CONSENT_KEY } from '../../src/utilities/campaignConsent.js'
|
||||
import { expect, test } from './fixtures/campaignE2EFixtures.js'
|
||||
|
||||
|
|
@ -8,7 +10,7 @@ import { expect, test } from './fixtures/campaignE2EFixtures.js'
|
|||
*/
|
||||
|
||||
const ensureSupporterRegistrationConsent = async (campaign: {
|
||||
payload: { find: Function; create: Function }
|
||||
payload: Pick<Payload, 'find' | 'create'>
|
||||
}) => {
|
||||
const existing = await campaign.payload.find({
|
||||
collection: 'consent',
|
||||
|
|
@ -29,7 +31,14 @@ const ensureSupporterRegistrationConsent = async (campaign: {
|
|||
children: [
|
||||
{
|
||||
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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue