Skip to content

Commit 3c7de84

Browse files
tatp22mmalerba
authored andcommitted
fix(cdk/testing): allow use of plaintext-only for contenteditable (#29999)
(cherry picked from commit b3c93c5)
1 parent aed9094 commit 3c7de84

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ export class SeleniumWebDriverElement implements TestElement {
161161
async setContenteditableValue(value: string): Promise<void> {
162162
const contenteditableAttr = await this.getAttribute('contenteditable');
163163

164-
if (contenteditableAttr !== '' && contenteditableAttr !== 'true') {
164+
if (
165+
contenteditableAttr !== '' &&
166+
contenteditableAttr !== 'true' &&
167+
contenteditableAttr !== 'plaintext-only'
168+
) {
165169
throw new Error('setContenteditableValue can only be called on a `contenteditable` element.');
166170
}
167171

src/cdk/testing/testbed/unit-test-element.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ export class UnitTestElement implements TestElement {
193193
async setContenteditableValue(value: string): Promise<void> {
194194
const contenteditableAttr = await this.getAttribute('contenteditable');
195195

196-
if (contenteditableAttr !== '' && contenteditableAttr !== 'true') {
196+
if (
197+
contenteditableAttr !== '' &&
198+
contenteditableAttr !== 'true' &&
199+
contenteditableAttr !== 'plaintext-only'
200+
) {
197201
throw new Error('setContenteditableValue can only be called on a `contenteditable` element.');
198202
}
199203

0 commit comments

Comments
 (0)