@@ -231,4 +231,45 @@ void main() {
231
231
expect (showErrorNotification, true );
232
232
});
233
233
});
234
+
235
+ group ('showErrorDialogFragment' , () {
236
+ test ('Should receive false if not Android' , () async {
237
+ debugDefaultTargetPlatformOverride = TargetPlatform .iOS;
238
+
239
+ final showErrorDialogFragment =
240
+ await const GoogleApiAvailability .private ().showErrorDialogFragment ();
241
+
242
+ expect (showErrorDialogFragment, false );
243
+
244
+ debugDefaultTargetPlatformOverride = null ;
245
+ });
246
+
247
+ test ('Should receive false when showErrorDialogFragment is null' , () async {
248
+ const showErrorDialogFragment = null ;
249
+
250
+ MethodChannelMock (
251
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
252
+ method: 'showErrorDialogFragment' ,
253
+ result: showErrorDialogFragment,
254
+ );
255
+
256
+ final showErrorDialogFragmentResult =
257
+ await const GoogleApiAvailability .private ().showErrorDialogFragment ();
258
+
259
+ expect (showErrorDialogFragmentResult, false );
260
+ });
261
+
262
+ test ('Should receive true when error dialog fragment is shown' , () async {
263
+ MethodChannelMock (
264
+ channelName: 'flutter.baseflow.com/google_api_availability/methods' ,
265
+ method: 'showErrorDialogFragment' ,
266
+ result: true ,
267
+ );
268
+
269
+ final showErrorDialogFragment =
270
+ await const GoogleApiAvailability .private ().showErrorDialogFragment ();
271
+
272
+ expect (showErrorDialogFragment, true );
273
+ });
274
+ });
234
275
}
0 commit comments