Skip to content

Commit

Permalink
Update CHANGELOGS and fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Jan 31, 2024
1 parent d4b5304 commit 2088be2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion geolocator_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 2.2.1

- Migrate tests to support sound null safety.
- Migrates tests to support sound null safety.

## 2.2.0

Expand Down
1 change: 1 addition & 0 deletions geolocator_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
geolocator_platform_interface: ^4.1.0

dev_dependencies:
build_runner: ^2.4.8
flutter_test:
sdk: flutter
flutter_lints: ^3.0.1
Expand Down
4 changes: 2 additions & 2 deletions geolocator_web/test/geolocator_utils_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Mocks generated by Mockito 5.4.1-wip from annotations
// in geolocator.web/test/geolocator_utils_test.dart.
// Mocks generated by Mockito 5.4.4 from annotations
// in geolocator_web/test/geolocator_utils_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
Expand Down
8 changes: 0 additions & 8 deletions geolocator_web/test/geolocator_web_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ void main() {
});

group('Permission methods', () {
test('checkPermission throws exception when permissionsSupported is false',
() async {
when(mockPermissionsManager.permissionsSupported).thenReturn(false);

expect(
geolocatorPlugin.checkPermission, throwsA(isA<PlatformException>()));
});

test('checkPermission returns the correct LocationPermission', () async {
when(mockPermissionsManager.permissionsSupported).thenReturn(true);

Expand Down
30 changes: 19 additions & 11 deletions geolocator_web/test/geolocator_web_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Mocks generated by Mockito 5.4.1-wip from annotations
// in geolocator.web/test/geolocator_web_test.dart.
// Mocks generated by Mockito 5.4.4 from annotations
// in geolocator_web/test/geolocator_web_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;

import 'package:mockito/mockito.dart' as _i1;
import 'package:geolocator_platform_interface/geolocator_platform_interface.dart'
as _i2;
import 'package:geolocator_web/src/geolocation_manager.dart' as _i3;
import 'package:geolocator_web/src/permissions_manager.dart' as _i5;
import 'package:mockito/mockito.dart' as _i1;

// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
Expand Down Expand Up @@ -39,10 +39,6 @@ class _FakePosition_0 extends _i1.SmartFake implements _i2.Position {
/// See the documentation for Mockito's code generation for more information.
class MockGeolocationManager extends _i1.Mock
implements _i3.GeolocationManager {
MockGeolocationManager() {
_i1.throwOnMissingStub(this);
}

@override
_i4.Future<_i2.Position> getCurrentPosition({
bool? enableHighAccuracy,
Expand All @@ -68,6 +64,18 @@ class MockGeolocationManager extends _i1.Mock
},
),
)),
returnValueForMissingStub:
_i4.Future<_i2.Position>.value(_FakePosition_0(
this,
Invocation.method(
#getCurrentPosition,
[],
{
#enableHighAccuracy: enableHighAccuracy,
#timeout: timeout,
},
),
)),
) as _i4.Future<_i2.Position>);

@override
Expand All @@ -85,6 +93,7 @@ class MockGeolocationManager extends _i1.Mock
},
),
returnValue: _i4.Stream<_i2.Position>.empty(),
returnValueForMissingStub: _i4.Stream<_i2.Position>.empty(),
) as _i4.Stream<_i2.Position>);
}

Expand All @@ -93,14 +102,11 @@ class MockGeolocationManager extends _i1.Mock
/// See the documentation for Mockito's code generation for more information.
class MockPermissionsManager extends _i1.Mock
implements _i5.PermissionsManager {
MockPermissionsManager() {
_i1.throwOnMissingStub(this);
}

@override
bool get permissionsSupported => (super.noSuchMethod(
Invocation.getter(#permissionsSupported),
returnValue: false,
returnValueForMissingStub: false,
) as bool);

@override
Expand All @@ -112,5 +118,7 @@ class MockPermissionsManager extends _i1.Mock
),
returnValue: _i4.Future<_i2.LocationPermission>.value(
_i2.LocationPermission.denied),
returnValueForMissingStub: _i4.Future<_i2.LocationPermission>.value(
_i2.LocationPermission.denied),
) as _i4.Future<_i2.LocationPermission>);
}

0 comments on commit 2088be2

Please sign in to comment.