Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ export class SeleniumWebDriverElement implements TestElement {
async matchesSelector(selector: string): Promise<boolean> {
await this._stabilize();
return this._executeScript(
(element: Element, s: string) =>
(Element.prototype.matches || (Element.prototype as any).msMatchesSelector).call(
element,
s,
),
(element: Element, s: string) => element.matches(s),
this.element(),
selector,
);
Expand Down
6 changes: 1 addition & 5 deletions src/cdk/testing/testbed/unit-test-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,7 @@ export class UnitTestElement implements TestElement {
/** Checks whether this element matches the given selector. */
async matchesSelector(selector: string): Promise<boolean> {
await this._stabilize();
const elementPrototype = Element.prototype as any;
return (elementPrototype['matches'] || elementPrototype['msMatchesSelector']).call(
this.element,
selector,
);
return this.element.matches(selector);
}

/** Checks whether the element is focused. */
Expand Down
Loading