fix(next): viewing modified-only diff view containing localized arrays throws error (#11006)
Fixes https://github.com/payloadcms/payload/issues/11002 `buildVersionFields` was adding `null` version fields to the version fields array. When RenderVersionFieldsToDiff tried to render those, it threw an error. This PR ensures no `null` fields are added, as `RenderVersionFieldsToDiff` can't process them. That way, those fields are properly skipped, which is the intent of `modifiedOnly`
This commit is contained in:
@@ -960,6 +960,18 @@ describe('Versions', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('correctly renders modified-only diff for localized array fields', async () => {
|
||||
await navigateToVersionFieldsDiff()
|
||||
|
||||
const textInArrayES = page.locator('[data-field-path="arrayLocalized"][data-locale="es"]')
|
||||
|
||||
await expect(textInArrayES).toContainText('No Array Localizeds found')
|
||||
|
||||
await page.locator('#modifiedOnly').click()
|
||||
|
||||
await expect(textInArrayES).toBeHidden()
|
||||
})
|
||||
|
||||
test('correctly renders diff for block fields', async () => {
|
||||
await navigateToVersionFieldsDiff()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user