chore: lexical int tests: do not use relationTo to collection with rich text relationships disabled
This commit is contained in:
@@ -56,7 +56,7 @@ export const uploadValidation = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (errorPaths.length) {
|
if (errorPaths.length) {
|
||||||
return 'Block validation failed: ' + errorPaths.join(', ')
|
return 'Upload fields validation failed: ' + errorPaths.join(', ')
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export function textToLexicalJSON({
|
|||||||
direction: 'ltr',
|
direction: 'ltr',
|
||||||
format: '',
|
format: '',
|
||||||
indent: 0,
|
indent: 0,
|
||||||
|
textFormat: 0,
|
||||||
type: 'paragraph',
|
type: 'paragraph',
|
||||||
version: 1,
|
version: 1,
|
||||||
} as SerializedParagraphNode,
|
} as SerializedParagraphNode,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { textFieldsSlug } from '../../slugs.js'
|
||||||
import { loremIpsum } from './loremIpsum.js'
|
import { loremIpsum } from './loremIpsum.js'
|
||||||
|
|
||||||
export function generateLexicalRichText() {
|
export function generateLexicalRichText() {
|
||||||
@@ -90,8 +91,8 @@ export function generateLexicalRichText() {
|
|||||||
fields: {
|
fields: {
|
||||||
url: 'https://',
|
url: 'https://',
|
||||||
doc: {
|
doc: {
|
||||||
value: '{{ARRAY_DOC_ID}}',
|
value: '{{TEXT_DOC_ID}}',
|
||||||
relationTo: 'array-fields',
|
relationTo: textFieldsSlug,
|
||||||
},
|
},
|
||||||
newTab: false,
|
newTab: false,
|
||||||
linkType: 'internal',
|
linkType: 'internal',
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import type { LexicalField, LexicalMigrateField, RichTextField } from './payload
|
|||||||
import { devUser } from '../credentials.js'
|
import { devUser } from '../credentials.js'
|
||||||
import { NextRESTClient } from '../helpers/NextRESTClient.js'
|
import { NextRESTClient } from '../helpers/NextRESTClient.js'
|
||||||
import { initPayloadInt } from '../helpers/initPayloadInt.js'
|
import { initPayloadInt } from '../helpers/initPayloadInt.js'
|
||||||
import { arrayDoc } from './collections/Array/shared.js'
|
|
||||||
import { lexicalDocData } from './collections/Lexical/data.js'
|
import { lexicalDocData } from './collections/Lexical/data.js'
|
||||||
import { lexicalMigrateDocData } from './collections/LexicalMigrate/data.js'
|
import { lexicalMigrateDocData } from './collections/LexicalMigrate/data.js'
|
||||||
import { richTextDocData } from './collections/RichText/data.js'
|
import { richTextDocData } from './collections/RichText/data.js'
|
||||||
@@ -172,7 +171,7 @@ describe('Lexical', () => {
|
|||||||
|
|
||||||
const linkNode: SerializedLinkNode = (lexical.root.children[1] as SerializedParagraphNode)
|
const linkNode: SerializedLinkNode = (lexical.root.children[1] as SerializedParagraphNode)
|
||||||
.children[3] as SerializedLinkNode
|
.children[3] as SerializedLinkNode
|
||||||
expect(linkNode.fields.doc.value.items[1].text).toStrictEqual(arrayDoc.items[1].text)
|
expect(linkNode.fields.doc.value.text).toStrictEqual(textDoc.text)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should populate relationship node', async () => {
|
it('should populate relationship node', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user