@@ -1018,24 +1018,22 @@ void main() {
1018
1018
check (store).isLoading.isTrue ();
1019
1019
}
1020
1020
1021
- void checkReloadFailure ({
1021
+ void checkReloadFailure (FakeAsync async , {
1022
1022
required FutureOr <void > Function () completeLoading,
1023
- }) {
1024
- awaitFakeAsync ((async ) async {
1025
- await prepareReload (async );
1026
- check (completers ()).single.isCompleted.isFalse ();
1023
+ }) async {
1024
+ await prepareReload (async );
1025
+ check (completers ()).single.isCompleted.isFalse ();
1027
1026
1028
- await completeLoading ();
1029
- check (completers ()).single.isCompleted.isTrue ();
1030
- check (globalStore.takeDoRemoveAccountCalls ()).single.equals (eg.selfAccount.id);
1027
+ await completeLoading ();
1028
+ check (completers ()).single.isCompleted.isTrue ();
1029
+ check (globalStore.takeDoRemoveAccountCalls ()).single.equals (eg.selfAccount.id);
1031
1030
1032
- async .elapse (TestGlobalStore .removeAccountDuration);
1033
- check (globalStore.perAccountSync (eg.selfAccount.id)).isNull ();
1031
+ async .elapse (TestGlobalStore .removeAccountDuration);
1032
+ check (globalStore.perAccountSync (eg.selfAccount.id)).isNull ();
1034
1033
1035
- async .flushTimers ();
1036
- // Reload never succeeds and there are no unhandled errors.
1037
- check (globalStore.perAccountSync (eg.selfAccount.id)).isNull ();
1038
- });
1034
+ async .flushTimers ();
1035
+ // Reload never succeeds and there are no unhandled errors.
1036
+ check (globalStore.perAccountSync (eg.selfAccount.id)).isNull ();
1039
1037
}
1040
1038
1041
1039
Future <void > logOutAndCompleteWithNewStore () async {
@@ -1047,15 +1045,15 @@ void main() {
1047
1045
}
1048
1046
1049
1047
test ('user logged out before new store is loaded' , () => awaitFakeAsync ((async ) async {
1050
- checkReloadFailure (completeLoading: logOutAndCompleteWithNewStore);
1048
+ checkReloadFailure (async , completeLoading: logOutAndCompleteWithNewStore);
1051
1049
}));
1052
1050
1053
1051
void completeWithApiExceptionUnauthorized () {
1054
1052
completers ().single.completeError (eg.apiExceptionUnauthorized ());
1055
1053
}
1056
1054
1057
1055
test ('new store is not loaded, gets HTTP 401 error instead' , () => awaitFakeAsync ((async ) async {
1058
- checkReloadFailure (completeLoading: completeWithApiExceptionUnauthorized);
1056
+ checkReloadFailure (async , completeLoading: completeWithApiExceptionUnauthorized);
1059
1057
}));
1060
1058
});
1061
1059
0 commit comments