Skip to content

Commit 4e223b3

Browse files
committed
tests: add integration tests for POI click
1 parent 95354ff commit 4e223b3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

example/integration_test/shared.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Future<GoogleMapViewController> getMapViewControllerForTestMapType(
240240
void Function(String)? onCircleClicked,
241241
void Function(LatLng)? onMapClicked,
242242
void Function(LatLng)? onMapLongClicked,
243+
void Function(PointOfInterest)? onPoiClicked,
243244
void Function(String, LatLng)? onMarkerDrag,
244245
void Function(String, LatLng)? onMarkerDragEnd,
245246
void Function(String, LatLng)? onMarkerDragStart,
@@ -266,6 +267,7 @@ Future<GoogleMapViewController> getMapViewControllerForTestMapType(
266267
onCircleClicked: onCircleClicked,
267268
onMapClicked: onMapClicked,
268269
onMapLongClicked: onMapLongClicked,
270+
onPoiClicked: onPoiClicked,
269271
onMarkerDrag: onMarkerDrag,
270272
onMarkerDragEnd: onMarkerDragEnd,
271273
onMarkerDragStart: onMarkerDragStart,
@@ -290,6 +292,7 @@ Future<GoogleMapViewController> getMapViewControllerForTestMapType(
290292
onCircleClicked: onCircleClicked,
291293
onMapClicked: onMapClicked,
292294
onMapLongClicked: onMapLongClicked,
295+
onPoiClicked: onPoiClicked,
293296
onMarkerDrag: onMarkerDrag,
294297
onMarkerDragEnd: onMarkerDragEnd,
295298
onMarkerDragStart: onMarkerDragStart,
@@ -322,6 +325,7 @@ Future<GoogleNavigationViewController> startNavigationWithoutDestination(
322325
void Function(String)? onCircleClicked,
323326
void Function(LatLng)? onMapClicked,
324327
void Function(LatLng)? onMapLongClicked,
328+
void Function(PointOfInterest)? onPoiClicked,
325329
void Function(String, LatLng)? onMarkerDrag,
326330
void Function(String, LatLng)? onMarkerDragEnd,
327331
void Function(String, LatLng)? onMarkerDragStart,
@@ -358,6 +362,7 @@ Future<GoogleNavigationViewController> startNavigationWithoutDestination(
358362
onCircleClicked: onCircleClicked,
359363
onMapClicked: onMapClicked,
360364
onMapLongClicked: onMapLongClicked,
365+
onPoiClicked: onPoiClicked,
361366
onMarkerDrag: onMarkerDrag,
362367
onMarkerDragEnd: onMarkerDragEnd,
363368
onMarkerDragStart: onMarkerDragStart,
@@ -408,6 +413,7 @@ Future<GoogleMapViewController> startMapView(
408413
void Function(String)? onCircleClicked,
409414
void Function(LatLng)? onMapClicked,
410415
void Function(LatLng)? onMapLongClicked,
416+
void Function(PointOfInterest)? onPoiClicked,
411417
void Function(String, LatLng)? onMarkerDrag,
412418
void Function(String, LatLng)? onMarkerDragEnd,
413419
void Function(String, LatLng)? onMarkerDragStart,
@@ -437,6 +443,7 @@ Future<GoogleMapViewController> startMapView(
437443
onCircleClicked: onCircleClicked,
438444
onMapClicked: onMapClicked,
439445
onMapLongClicked: onMapLongClicked,
446+
onPoiClicked: onPoiClicked,
440447
onMarkerDrag: onMarkerDrag,
441448
onMarkerDragEnd: onMarkerDragEnd,
442449
onMarkerDragStart: onMarkerDragStart,

example/integration_test/t06_map_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ void main() {
187187
);
188188
}
189189

190+
void onPoiClicked(PointOfInterest poi) {
191+
$.log(
192+
'POI clicked event: placeId=${poi.placeId}, name=${poi.name}, '
193+
'lat=${poi.latLng.latitude}, lng=${poi.latLng.longitude}.',
194+
);
195+
}
196+
190197
/// Set up navigation without initialization to test isMyLocationEnabled
191198
/// is false before initialization is done. Test the onMapClicked event
192199
/// and setting the other callback functions.
@@ -203,6 +210,7 @@ void main() {
203210
onMapLongClicked: onMapLongClicked,
204211
onMyLocationButtonClicked: onMyLocationButtonClicked,
205212
onMyLocationClicked: onMyLocationClicked,
213+
onPoiClicked: onPoiClicked,
206214
);
207215

208216
/// Test that the onMapClicked event comes in.

0 commit comments

Comments
 (0)