Skip to content

Commit

Permalink
fix(cdk/testing): allow use of plaintext-only for contenteditable (
Browse files Browse the repository at this point in the history
  • Loading branch information
tatp22 authored Nov 13, 2024
1 parent 3a7724e commit b3c93c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ export class SeleniumWebDriverElement implements TestElement {
async setContenteditableValue(value: string): Promise<void> {
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.');
}

Expand Down
6 changes: 5 additions & 1 deletion src/cdk/testing/testbed/unit-test-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ export class UnitTestElement implements TestElement {
async setContenteditableValue(value: string): Promise<void> {
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.');
}

Expand Down

0 comments on commit b3c93c5

Please sign in to comment.