fix: localised relationship fields (#7178)

Fixes the issue where locale is not passed into the relationship field
resulting in documents without titles in some situations


![image](https://github.com/user-attachments/assets/67f0a70c-29a0-4f54-a395-f4aa9b132d6f)
This commit is contained in:
Paul
2024-07-16 15:22:37 -04:00
committed by GitHub
parent 0371aea711
commit 2f0aa83a93
2 changed files with 31 additions and 9 deletions

View File

@@ -234,6 +234,23 @@ describe('Localization', () => {
await expect(page.locator('.row-1 .cell-title')).toContainText(spanishTitle)
})
})
describe('localized relationships', () => {
test('ensure relationship field fetches are localised as well', async () => {
await page.goto(url.list)
await changeLocale(page, spanishLocale)
const localisedPost = page.locator('.cell-title a').first()
const localisedPostUrl = await localisedPost.getAttribute('href')
await page.goto(serverURL + localisedPostUrl)
await page.waitForURL(serverURL + localisedPostUrl)
const selectField = page.locator('#field-children .rs__control')
await selectField.click()
await expect(page.locator('#field-children .rs__menu')).toContainText('spanish-relation2')
})
})
})
async function fillValues(data: Partial<LocalizedPost>) {