Skip to content

Commit

Permalink
test(map): test registering maps without id (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
usefulthink authored Sep 25, 2023
1 parent 3770ba6 commit 80158c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/__tests__/map.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ test('map instance is created after api is loaded', async () => {
expect(createMapSpy).toHaveBeenCalled();
});

test("doesn't register map when no id is specified", () => {
test("map is registered as 'default' when no id is specified", () => {
render(<GoogleMap />, {wrapper});

expect(mockContextValue.addMapInstance).not.toHaveBeenCalled();
expect(mockContextValue.addMapInstance).toHaveBeenCalledWith(
mockInstances.get(google.maps.Map).at(-1),
undefined
);
});

test('throws an exception when rendering outside API provider', () => {
Expand Down

0 comments on commit 80158c0

Please sign in to comment.