Files
payloadcms/test/helpers/e2e/getRowByCellValueAndAssert.ts
Jarrod Flesch dc732b8f52 fix(ui): populate nested fields for enableListViewSelectAPI (#13827)
Fixes an issue with the new experimental `enableListViewSelectAPI`
config option.

Group fields were not populating properly in the list view

### Before (incorrect)
```ts
{
  group.field: true
}
```

### After (correct)
```ts
{
  group: {
    field: true
  }
}
```
2025-09-16 21:23:08 +00:00

24 lines
492 B
TypeScript

import type { Locator, Page } from '@playwright/test'
import { expect } from '@playwright/test'
export async function getRowByCellValueAndAssert({
page,
textToMatch,
cellClass,
}: {
cellClass: `.cell-${string}`
page: Page
textToMatch: string
}): Promise<Locator> {
const row = page
.locator(`.collection-list .table tr`)
.filter({
has: page.locator(`${cellClass}`, { hasText: textToMatch }),
})
.first()
await expect(row).toBeVisible()
return row
}