Skip to content

Commit 80158c0

Browse files
authored
test(map): test registering maps without id (visgl#6)
1 parent 3770ba6 commit 80158c0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/__tests__/map.test.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ test('map instance is created after api is loaded', async () => {
6464
expect(createMapSpy).toHaveBeenCalled();
6565
});
6666

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

70-
expect(mockContextValue.addMapInstance).not.toHaveBeenCalled();
70+
expect(mockContextValue.addMapInstance).toHaveBeenCalledWith(
71+
mockInstances.get(google.maps.Map).at(-1),
72+
undefined
73+
);
7174
});
7275

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

0 commit comments

Comments
 (0)