diff --git a/src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts b/src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts index 6435279f1c46..997bc7e703a1 100644 --- a/src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts +++ b/src/cdk/testing/selenium-webdriver/selenium-web-driver-element.ts @@ -161,7 +161,11 @@ export class SeleniumWebDriverElement implements TestElement { async setContenteditableValue(value: string): Promise { const contenteditableAttr = await this.getAttribute('contenteditable'); - if (contenteditableAttr !== '' && contenteditableAttr !== 'true') { + if ( + contenteditableAttr !== '' && + contenteditableAttr !== 'true' && + contenteditableAttr !== 'plaintext-only' + ) { throw new Error('setContenteditableValue can only be called on a `contenteditable` element.'); } diff --git a/src/cdk/testing/testbed/unit-test-element.ts b/src/cdk/testing/testbed/unit-test-element.ts index f441fd43af6b..0e2a5b21806b 100644 --- a/src/cdk/testing/testbed/unit-test-element.ts +++ b/src/cdk/testing/testbed/unit-test-element.ts @@ -193,7 +193,11 @@ export class UnitTestElement implements TestElement { async setContenteditableValue(value: string): Promise { const contenteditableAttr = await this.getAttribute('contenteditable'); - if (contenteditableAttr !== '' && contenteditableAttr !== 'true') { + if ( + contenteditableAttr !== '' && + contenteditableAttr !== 'true' && + contenteditableAttr !== 'plaintext-only' + ) { throw new Error('setContenteditableValue can only be called on a `contenteditable` element.'); }