Skip to content

Commit

Permalink
fix: initialize element property of AdvancedMarkerElement (#568)
Browse files Browse the repository at this point in the history
Add initialization of the `advancedMarkerEl.element` property. In the real API this is initialized in the constructor and is guaranteed to be an html-element, so it has to be here as well.
  • Loading branch information
usefulthink authored Nov 30, 2023
1 parent 49e9940 commit 2b2c6bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ test("registers mocks", () => {
});

expect(mockInstances.get(AdvancedMarkerElement)[0].title).toBe("Howdy");

expect(mockInstances.get(AdvancedMarkerElement)[0].element).toBeDefined();
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export class AdvancedMarkerElement

constructor(options?: google.maps.marker.AdvancedMarkerElementOptions) {
super();

this.element = document.createElement("div");

__registerMockInstance(this.constructor, this);
}
}
Expand Down

0 comments on commit 2b2c6bb

Please sign in to comment.