fix(db-postgres): x3 and more nested blocks regression (#12770)

This commit is contained in:
Sasha
2025-06-12 19:37:07 +03:00
committed by GitHub
parent e7b5884ec2
commit df8be92d47
7 changed files with 119 additions and 6 deletions

View File

@@ -2666,4 +2666,28 @@ describe('database', () => {
expect((e as ValidationError).message).toEqual('The following field is invalid: slugField')
}
})
it('should support x3 nesting blocks', async () => {
const res = await payload.create({
collection: 'posts',
data: {
title: 'title',
blocks: [
{
blockType: 'block',
nested: [
{
blockType: 'block',
nested: [],
},
],
},
],
},
})
expect(res.blocks).toHaveLength(1)
expect(res.blocks[0]?.nested).toHaveLength(1)
expect(res.blocks[0]?.nested[0]?.nested).toHaveLength(0)
})
})