chore(alpha): update fields-relationship e2e tests (#5553)

* fix: handles filter options in form state merge

* chore: fix and reintegrate fields-relationship e2e tests

* chore: update withMergedProps function for e2e tests
This commit is contained in:
Jessica Chowdhury
2024-04-03 16:11:19 +01:00
committed by GitHub
parent 2a8b678a4b
commit 7cccca8194
5 changed files with 17 additions and 4 deletions

View File

@@ -192,7 +192,7 @@ export default buildConfigWithDefaults({
},
{
admin: {
useAsTitle: 'meta.title',
useAsTitle: 'name',
},
fields: [
...baseRelationshipFields,

View File

@@ -251,7 +251,7 @@ describe('fields - relationship', () => {
// then verify that the filtered field's options match
let filteredField = page.locator(`#field-${fieldName} .react-select`)
await filteredField.click({ delay: 100 })
const filteredOptions = filteredField.locator('.rs__option')
let filteredOptions = filteredField.locator('.rs__option')
await expect(filteredOptions).toHaveCount(1) // one doc
await filteredOptions.nth(0).click()
await expect(filteredField).toContainText(relationOneDoc.id)
@@ -268,6 +268,7 @@ describe('fields - relationship', () => {
// then verify that the filtered field's options match
filteredField = page.locator(`#field-${fieldName} .react-select`)
await filteredField.click({ delay: 100 })
filteredOptions = filteredField.locator('.rs__option')
await expect(filteredOptions).toHaveCount(2) // two options because the currently selected option is still there
await filteredOptions.nth(1).click()
await expect(filteredField).toContainText(anotherRelationOneDoc.id)