@trackunit/react-test-setup 1.4.34 → 1.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +6 -2
- package/index.esm.js +6 -2
- package/package.json +1 -1
- package/src/setupGoogleMaps.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -76,11 +76,11 @@ const getPlacePredictionsMock = jest.fn();
|
|
|
76
76
|
* Sets up mocks for Google Maps API and @vis.gl/react-google-maps components in testing environments.
|
|
77
77
|
*
|
|
78
78
|
* This function mocks both the Google Maps JavaScript API and React components from @vis.gl/react-google-maps.
|
|
79
|
-
* It provides mock implementations of Maps, Markers, Geocoder, geometry functions, and places services,
|
|
79
|
+
* It provides mock implementations of Maps, Markers, InfoWindows, Geocoder, geometry functions, and places services,
|
|
80
80
|
* allowing tests of map-dependent components to run without requiring the actual Google Maps API.
|
|
81
81
|
*
|
|
82
82
|
* Key features:
|
|
83
|
-
* - Mocks core Map and
|
|
83
|
+
* - Mocks core Map, Marker, and InfoWindow components with simple test-friendly implementations
|
|
84
84
|
* - Provides placeholders for Google Maps geometry calculations
|
|
85
85
|
* - Stubs out Places API services
|
|
86
86
|
* - Makes map-related hooks always return loaded state
|
|
@@ -107,6 +107,9 @@ const setupGoogleMaps = () => {
|
|
|
107
107
|
const MapMarkerMock = jest.fn(props => {
|
|
108
108
|
return jsxRuntime.jsx("div", { "data-testid": "map", children: props.children });
|
|
109
109
|
});
|
|
110
|
+
const InfoWindowMock = jest.fn(props => {
|
|
111
|
+
return jsxRuntime.jsx("div", { "data-testid": "google-info-window", children: props.children });
|
|
112
|
+
});
|
|
110
113
|
return {
|
|
111
114
|
...originalModule,
|
|
112
115
|
useApiLoadingStatus: () => reactGoogleMaps.APILoadingStatus.LOADED,
|
|
@@ -115,6 +118,7 @@ const setupGoogleMaps = () => {
|
|
|
115
118
|
AdvancedMarker: AdvancedMarkerMock,
|
|
116
119
|
Map: MapMock,
|
|
117
120
|
Marker: MapMarkerMock,
|
|
121
|
+
InfoWindow: InfoWindowMock,
|
|
118
122
|
};
|
|
119
123
|
});
|
|
120
124
|
beforeEach(() => {
|
package/index.esm.js
CHANGED
|
@@ -55,11 +55,11 @@ const getPlacePredictionsMock = jest.fn();
|
|
|
55
55
|
* Sets up mocks for Google Maps API and @vis.gl/react-google-maps components in testing environments.
|
|
56
56
|
*
|
|
57
57
|
* This function mocks both the Google Maps JavaScript API and React components from @vis.gl/react-google-maps.
|
|
58
|
-
* It provides mock implementations of Maps, Markers, Geocoder, geometry functions, and places services,
|
|
58
|
+
* It provides mock implementations of Maps, Markers, InfoWindows, Geocoder, geometry functions, and places services,
|
|
59
59
|
* allowing tests of map-dependent components to run without requiring the actual Google Maps API.
|
|
60
60
|
*
|
|
61
61
|
* Key features:
|
|
62
|
-
* - Mocks core Map and
|
|
62
|
+
* - Mocks core Map, Marker, and InfoWindow components with simple test-friendly implementations
|
|
63
63
|
* - Provides placeholders for Google Maps geometry calculations
|
|
64
64
|
* - Stubs out Places API services
|
|
65
65
|
* - Makes map-related hooks always return loaded state
|
|
@@ -86,6 +86,9 @@ const setupGoogleMaps = () => {
|
|
|
86
86
|
const MapMarkerMock = jest.fn(props => {
|
|
87
87
|
return jsx("div", { "data-testid": "map", children: props.children });
|
|
88
88
|
});
|
|
89
|
+
const InfoWindowMock = jest.fn(props => {
|
|
90
|
+
return jsx("div", { "data-testid": "google-info-window", children: props.children });
|
|
91
|
+
});
|
|
89
92
|
return {
|
|
90
93
|
...originalModule,
|
|
91
94
|
useApiLoadingStatus: () => APILoadingStatus.LOADED,
|
|
@@ -94,6 +97,7 @@ const setupGoogleMaps = () => {
|
|
|
94
97
|
AdvancedMarker: AdvancedMarkerMock,
|
|
95
98
|
Map: MapMock,
|
|
96
99
|
Marker: MapMarkerMock,
|
|
100
|
+
InfoWindow: InfoWindowMock,
|
|
97
101
|
};
|
|
98
102
|
});
|
|
99
103
|
beforeEach(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-test-setup",
|
|
3
3
|
"description": "Test setup utilities for React applications",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.37",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
7
7
|
"engines": {
|
package/src/setupGoogleMaps.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Sets up mocks for Google Maps API and @vis.gl/react-google-maps components in testing environments.
|
|
3
3
|
*
|
|
4
4
|
* This function mocks both the Google Maps JavaScript API and React components from @vis.gl/react-google-maps.
|
|
5
|
-
* It provides mock implementations of Maps, Markers, Geocoder, geometry functions, and places services,
|
|
5
|
+
* It provides mock implementations of Maps, Markers, InfoWindows, Geocoder, geometry functions, and places services,
|
|
6
6
|
* allowing tests of map-dependent components to run without requiring the actual Google Maps API.
|
|
7
7
|
*
|
|
8
8
|
* Key features:
|
|
9
|
-
* - Mocks core Map and
|
|
9
|
+
* - Mocks core Map, Marker, and InfoWindow components with simple test-friendly implementations
|
|
10
10
|
* - Provides placeholders for Google Maps geometry calculations
|
|
11
11
|
* - Stubs out Places API services
|
|
12
12
|
* - Makes map-related hooks always return loaded state
|