mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-24 09:03:11 +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 { 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',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue