mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
wip
This commit is contained in:
parent
737daad6d0
commit
4ff6e40c4a
1 changed files with 19 additions and 1 deletions
|
@ -79,6 +79,24 @@ void main() {
|
|||
.having((state) => state.error, "error", CameraErrorType.permissionNotGranted),
|
||||
],
|
||||
);
|
||||
|
||||
blocTest<CameraContainerBloc, CameraContainerState>(
|
||||
'Request granted -> check granted',
|
||||
build: () => bloc,
|
||||
setUp: () {
|
||||
when(() => meteringInteractor.requestPermission()).thenAnswer((_) async => true);
|
||||
when(() => meteringInteractor.checkCameraPermission()).thenAnswer((_) async => true);
|
||||
},
|
||||
act: (bloc) => bloc.add(const RequestPermissionEvent()),
|
||||
verify: (_) {
|
||||
verify(() => meteringInteractor.requestPermission()).called(1);
|
||||
verify(() => meteringInteractor.checkCameraPermission()).called(1);
|
||||
},
|
||||
expect: () => [
|
||||
isA<CameraLoadingState>(),
|
||||
// Proceed to `InitializeEvent` tests from here
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -101,7 +119,7 @@ void main() {
|
|||
];
|
||||
|
||||
blocTest<CameraContainerBloc, CameraContainerState>(
|
||||
'No cameras detected',
|
||||
'No cameras detected error',
|
||||
setUp: () {
|
||||
when(() => meteringInteractor.checkCameraPermission()).thenAnswer((_) async => true);
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
|
|
Loading…
Reference in a new issue