chore: replace incorrect usage of saveDocAndAssert helpers

This commit is contained in:
Alessio Gravili
2024-03-27 16:17:46 -04:00
parent e6d4445a8a
commit 8deb19e3ac

View File

@@ -300,7 +300,8 @@ describe('access control', () => {
const documentDrawer = page.locator('[id^=doc-drawer_user-restricted_1_]') const documentDrawer = page.locator('[id^=doc-drawer_user-restricted_1_]')
await expect(documentDrawer).toBeVisible() await expect(documentDrawer).toBeVisible()
await documentDrawer.locator('#field-name').fill('anonymous@email.com') await documentDrawer.locator('#field-name').fill('anonymous@email.com')
await saveDocAndAssert(page) await documentDrawer.locator('#action-save').click()
await expect(page.locator('.Toastify')).toContainText('successfully')
// ensure user is not allowed to edit this document // ensure user is not allowed to edit this document
await expect(documentDrawer.locator('#field-name')).toBeDisabled() await expect(documentDrawer.locator('#field-name')).toBeDisabled()
@@ -311,7 +312,8 @@ describe('access control', () => {
const documentDrawer2 = page.locator('[id^=doc-drawer_user-restricted_1_]') const documentDrawer2 = page.locator('[id^=doc-drawer_user-restricted_1_]')
await expect(documentDrawer2).toBeVisible() await expect(documentDrawer2).toBeVisible()
await documentDrawer2.locator('#field-name').fill('dev@payloadcms.com') await documentDrawer2.locator('#field-name').fill('dev@payloadcms.com')
await saveDocAndAssert(page) await documentDrawer2.locator('#action-save').click()
await expect(page.locator('.Toastify')).toContainText('successfully')
// ensure user is allowed to edit this document // ensure user is allowed to edit this document
await expect(documentDrawer2.locator('#field-name')).toBeEnabled() await expect(documentDrawer2.locator('#field-name')).toBeEnabled()