fix: disallow duplicate fieldNames to be used on the same level in the config (#4381)

This commit is contained in:
Jarrod Flesch
2023-12-11 16:52:24 -05:00
committed by GitHub
parent 548e78c598
commit a1d66b83e0
14 changed files with 758 additions and 279 deletions

View File

@@ -29,6 +29,7 @@ import {
import { tabsDoc } from './collections/Tabs/shared'
import { defaultText } from './collections/Text/shared'
import { clearAndSeedEverything } from './seed'
import { GroupField } from './payload-types'
import {
arrayFieldsSlug,
blockFieldsSlug,
@@ -587,10 +588,10 @@ describe('Fields', () => {
})
it('should create with ids and nested ids', async () => {
const docWithIDs = await payload.create({
const docWithIDs = (await payload.create({
collection: groupFieldsSlug,
data: groupDoc,
})
})) as Partial<GroupField>
expect(docWithIDs.group.subGroup.arrayWithinGroup[0].id).toBeDefined()
})