File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
packages/api/amplify_api_dart/test/web_socket Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -639,6 +639,48 @@ void main() {
639
639
640
640
await bloc.done.future;
641
641
});
642
+
643
+ test ('a process unpauses with autoReconnect disabled' , () async {
644
+ final blocReady = Completer <void >();
645
+ final subscribeEvent = SubscribeEvent (
646
+ subscriptionRequest,
647
+ blocReady.complete,
648
+ );
649
+ final bloc = getWebSocketBloc ();
650
+
651
+ expect (
652
+ bloc.stream,
653
+ emitsInOrder (
654
+ [
655
+ isA <DisconnectedState >(),
656
+ isA <ConnectingState >(),
657
+ isA <ConnectedState >(),
658
+ isA <FailureState >(),
659
+ isA <PendingDisconnect >(),
660
+ isA <DisconnectedState >(),
661
+ ],
662
+ ),
663
+ );
664
+
665
+ // ignore: invalid_use_of_internal_member
666
+ WebSocketOptions .autoReconnect = false ;
667
+
668
+ bloc.subscribe (subscribeEvent).listen (
669
+ null ,
670
+ onError: expectAsync1 ((event) {
671
+ expect (
672
+ event,
673
+ isA <ApiException >(),
674
+ );
675
+ }),
676
+ );
677
+
678
+ await blocReady.future;
679
+
680
+ mockProcessLifeCycleController
681
+ ..add (ProcessStatus .paused)
682
+ ..add (ProcessStatus .resumed);
683
+ });
642
684
});
643
685
});
644
686
}
You can’t perform that action at this time.
0 commit comments