fix(ui): lexical was incorrectly set to readonly in blocks (#9237)
Fixes a bug introduced in `beta-131` that rendered Lexical fields as read-only if they were within a block.
This commit is contained in:
@@ -65,6 +65,7 @@ describe('access control', () => {
|
||||
let restrictedUrl: AdminUrlUtil
|
||||
let unrestrictedURL: AdminUrlUtil
|
||||
let readOnlyCollectionUrl: AdminUrlUtil
|
||||
let richTextUrl: AdminUrlUtil
|
||||
let readOnlyGlobalUrl: AdminUrlUtil
|
||||
let restrictedVersionsUrl: AdminUrlUtil
|
||||
let userRestrictedCollectionURL: AdminUrlUtil
|
||||
@@ -80,6 +81,7 @@ describe('access control', () => {
|
||||
|
||||
url = new AdminUrlUtil(serverURL, slug)
|
||||
restrictedUrl = new AdminUrlUtil(serverURL, fullyRestrictedSlug)
|
||||
richTextUrl = new AdminUrlUtil(serverURL, 'rich-text')
|
||||
unrestrictedURL = new AdminUrlUtil(serverURL, unrestrictedSlug)
|
||||
readOnlyCollectionUrl = new AdminUrlUtil(serverURL, readOnlySlug)
|
||||
readOnlyGlobalUrl = new AdminUrlUtil(serverURL, readOnlySlug)
|
||||
@@ -147,6 +149,28 @@ describe('access control', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('rich text', () => {
|
||||
test('rich text within block should render as editable', async () => {
|
||||
await page.goto(richTextUrl.create)
|
||||
|
||||
await page.locator('.blocks-field__drawer-toggler').click()
|
||||
await page.locator('.thumbnail-card').click()
|
||||
const richTextField = page.locator('.rich-text-lexical')
|
||||
const contentEditable = richTextField.locator('.ContentEditable__root').first()
|
||||
await expect(contentEditable).toBeVisible()
|
||||
await contentEditable.click()
|
||||
|
||||
const typedText = 'Hello, this field is editable!'
|
||||
await page.keyboard.type(typedText)
|
||||
|
||||
await expect(
|
||||
page.locator('[data-lexical-text="true"]', {
|
||||
hasText: exactText(typedText),
|
||||
}),
|
||||
).toHaveCount(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('collection — fully restricted', () => {
|
||||
let existingDoc: ReadOnlyCollection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user