test: stabilize frequent fails (#13318)

Adjusts tests that "flake" frequently.
This commit is contained in:
Jarrod Flesch
2025-07-30 08:52:01 -04:00
committed by GitHub
parent e7124f6176
commit a22f27de1c
13 changed files with 47 additions and 71 deletions

View File

@@ -57,17 +57,6 @@ test.describe('Group By', () => {
password: devUser.password,
},
})
// Fetch category IDs from already-seeded data
const categories = await payload.find({
collection: 'categories',
limit: 1,
sort: 'title',
where: { title: { equals: 'Category 1' } },
})
const [category1] = categories.docs
category1Id = category1?.id as number | string
})
beforeEach(async () => {
@@ -649,7 +638,12 @@ test.describe('Group By', () => {
await firstTable.locator('.row-1 .cell-_select input').check()
await firstTable.locator('.list-selection__button[aria-label="Delete"]').click()
const modalId = `[id^="${category1Id}-confirm-delete-many-docs"]`
const firstGroupID = await firstTable
.locator('.group-by-header__heading')
.getAttribute('data-group-id')
const modalId = `[id^="${firstGroupID}-confirm-delete-many-docs"]`
await expect(page.locator(modalId)).toBeVisible()
// Confirm trash (skip permanent delete)
await page.locator(`${modalId} #confirm-action`).click()