* fix(richtext-lexical): make sure block fields are wrapped in a uniquely-named group * chore: remove redundant hook * chore(richtext-lexical): attempt to fix unnecessary unsaved changes warning regression * cleanup everything * chore: more cleanup * debug * looks like properly cloning the formdata for setting initial state fixes the issue where the old formdata is updated even if node.setFields is not called * chore: fix e2e tests * chore: fix e2e tests (a selector has changed) * chore: fix int tests (due to new blocks data format) * chore: fix incorrect insert block commands in drawer * chore: add new e2e test * chore: fail e2e tests when there are browser console errors * fix(breaking): beforeInput and afterInput: fix missing key errors, consistent typing and cases in name
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import { expect, test } from '@playwright/test'
|
|
|
|
import { closeNav, initPageConsoleErrorCatch, openNav } from '../helpers'
|
|
import { initPayloadE2E } from '../helpers/configHelpers'
|
|
|
|
const { beforeAll, describe } = test
|
|
|
|
describe('refresh-permissions', () => {
|
|
let serverURL: string
|
|
let page: Page
|
|
|
|
beforeAll(async ({ browser }) => {
|
|
;({ serverURL } = await initPayloadE2E(__dirname))
|
|
const context = await browser.newContext()
|
|
page = await context.newPage()
|
|
|
|
initPageConsoleErrorCatch(page)
|
|
})
|
|
|
|
test('should show test global immediately after allowing access', async () => {
|
|
await page.goto(`${serverURL}/admin/globals/settings`)
|
|
|
|
await openNav(page)
|
|
|
|
// Ensure that we have loaded accesses by checking that settings collection
|
|
// at least is visible in the menu.
|
|
await expect(page.locator('#nav-global-settings')).toBeVisible()
|
|
|
|
// Test collection should be hidden at first.
|
|
await expect(page.locator('#nav-global-test')).toBeHidden()
|
|
|
|
await closeNav(page)
|
|
|
|
// Allow access to test global.
|
|
await page.locator('.checkbox-input:has(#field-test) input').check()
|
|
await page.locator('#action-save').click()
|
|
|
|
await openNav(page)
|
|
|
|
// Now test collection should appear in the menu.
|
|
await expect(page.locator('#nav-global-test')).toBeVisible()
|
|
})
|
|
})
|