Skip to content

Commit

Permalink
fix(cdk/testing): avoid using dotted property access for dispatchEven… (
Browse files Browse the repository at this point in the history
#20754)

* fix(cdk/testing): avoid using dotted property access for dispatchEvent on ElementFinder

 * Internally this was causing an error saying that the type has a
  string index signature, but it is being accessed using a dotted property access.

* fixup! fix(cdk/testing): avoid using dotted property access for dispatchEvent on ElementFinder
  • Loading branch information
wagnermaciel authored Oct 9, 2020
1 parent a217509 commit 7d99c35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cdk/testing/protractor/protractor-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,6 @@ export class ProtractorElement implements TestElement {
function _dispatchEvent(name: string, element: ElementFinder) {
const event = document.createEvent('Event');
event.initEvent(name);
element.dispatchEvent(event);
// This type has a string index signature, so we cannot access it using a dotted property access.
element['dispatchEvent'](event);
}

0 comments on commit 7d99c35

Please sign in to comment.