From a298e15370766c401202acacdb84659dbc543965 Mon Sep 17 00:00:00 2001 From: Martin Schuhfuss Date: Mon, 25 Sep 2023 20:09:57 +0200 Subject: [PATCH] test(map): test registering maps without id --- src/components/__tests__/map.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/__tests__/map.test.tsx b/src/components/__tests__/map.test.tsx index c6ce02e7..ce1f2b64 100644 --- a/src/components/__tests__/map.test.tsx +++ b/src/components/__tests__/map.test.tsx @@ -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(, {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', () => {