@@ -49,7 +49,7 @@ void main() {
4949 externalContactsRepository = MockExternalContactsRepository ();
5050 contactsRepository = MockContactsRepository ();
5151
52- when (() => userRepository.getLocalInfo ()).thenAnswer ((_) => _testUser);
52+ when (() => userRepository.getAndListen ()).thenAnswer ((_) => Stream . value ( _testUser) );
5353 when (() => externalContactsRepository.load ()).thenAnswer ((_) async {});
5454 when (() => contactsRepository.syncExternalContacts (any ())).thenAnswer ((_) async {});
5555 });
@@ -116,7 +116,7 @@ void main() {
116116 'emits RefreshFailure if UserRepository fails during update' ,
117117 build: () {
118118 when (() => externalContactsRepository.contacts ()).thenAnswer ((_) => Stream .value ([_contactOther]));
119- when (() => userRepository.getLocalInfo ()).thenThrow ( Exception ('User info error' ));
119+ when (() => userRepository.getAndListen ()).thenAnswer ((_) => Stream . error ( Exception ('User info error' ) ));
120120
121121 return ExternalContactsSyncBloc (
122122 userRepository: userRepository,
@@ -126,7 +126,8 @@ void main() {
126126 },
127127 act: (bloc) => bloc.add (const ExternalContactsSyncStarted ()),
128128 skip: 1 ,
129- expect: () => [const ExternalContactsSyncRefreshFailure ()],
129+ wait: const Duration (seconds: 5 ),
130+ expect: () => [const ExternalContactsSyncUpdateFailure ()],
130131 );
131132 });
132133}
0 commit comments