@@ -71,11 +71,8 @@ void main() {
7171 // Account restoration may resume independently of the Add choices.
7272 await f.flow.signInAccount ();
7373 await f.settle (tester);
74- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
75- expect (f.probes, isEmpty);
76- await tester.tap (find.byType (CommunityGridOption ).first);
77- await f.settle (tester);
78- }
74+ expect (f.flow.stage, HostedFlowStage .setupIdentity);
75+ expect (f.probes, isEmpty);
7976 expect (find.text ('Create my Buzz identity' ), findsOneWidget);
8077 expect (find.text ('Import existing identity' ), findsOneWidget);
8178 expect (await f.store.read (), isNull);
@@ -127,11 +124,8 @@ void main() {
127124 // Account restoration may resume independently of the Add choices.
128125 await f.flow.signInAccount ();
129126 await f.settle (tester);
130- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
131- expect (f.probes, isEmpty);
132- await tester.tap (find.byType (CommunityGridOption ).first);
133- await f.settle (tester);
134- }
127+ expect (f.flow.stage, HostedFlowStage .setupIdentity);
128+ expect (f.probes, isEmpty);
135129 expect (find.text ('Create my Buzz identity' ), findsNothing);
136130 expect (find.text ('Import existing identity' ), findsOneWidget);
137131 await f.tap (tester, 'Import existing identity' );
@@ -188,11 +182,10 @@ void main() {
188182 // Account restoration may resume independently of the Add choices.
189183 await f.flow.signInAccount ();
190184 await f.settle (tester);
191- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
192- expect (f.probes, isEmpty);
193- await tester.tap (find.byType (CommunityGridOption ).first);
194- await f.settle (tester);
195- }
185+ expect (f.flow.stage, HostedFlowStage .chooseCommunities);
186+ expect (f.probes, isEmpty);
187+ await tester.tap (find.byType (CommunityGridOption ).first);
188+ await f.settle (tester);
196189 await tester.tap (find.byTooltip ('Add profile photo' ));
197190 await f.settle (tester);
198191 expect (find.byType (ProfileSetupAvatarEditor ), findsOneWidget);
@@ -215,11 +208,10 @@ void main() {
215208 // Account restoration may resume independently of the Add choices.
216209 await f.flow.signInAccount ();
217210 await f.settle (tester);
218- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
219- expect (f.probes, isEmpty);
220- await tester.tap (find.byType (CommunityGridOption ).first);
221- await f.settle (tester);
222- }
211+ expect (f.flow.stage, HostedFlowStage .chooseCommunities);
212+ expect (f.probes, isEmpty);
213+ await tester.tap (find.byType (CommunityGridOption ).first);
214+ await f.settle (tester);
223215 await tester.tap (find.byTooltip ('Add profile photo' ));
224216 await f.settle (tester);
225217 final url = emojiAvatarDataUrl ('🐝' , 0xFFFFE75C );
@@ -631,11 +623,11 @@ void main() {
631623 // Account restoration may resume independently of the Add choices.
632624 await f.flow.signInAccount ();
633625 await f.settle (tester);
634- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
635- expect (f.probes, isEmpty);
636- await tester. tap (find. byType ( CommunityGridOption ).first);
637- await f. settle (tester );
638- }
626+ expect (
627+ f.flow.stage,
628+ boundAccount ? HostedFlowStage .idle : HostedFlowStage .chooseIdentity,
629+ );
630+ expect (f.probes, isEmpty);
639631 if (! boundAccount) {
640632 expect (find.text ('Saved identity' ), findsOneWidget);
641633 expect (f.sent ('/verify' ), isEmpty);
@@ -674,11 +666,8 @@ void main() {
674666 // Account restoration may resume independently of the Add choices.
675667 await f.flow.signInAccount ();
676668 await f.settle (tester);
677- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
678- expect (f.probes, isEmpty);
679- await tester.tap (find.byType (CommunityGridOption ).first);
680- await f.settle (tester);
681- }
669+ expect (f.flow.stage, HostedFlowStage .chooseIdentity);
670+ expect (f.probes, isEmpty);
682671 expect (find.text ('Use Builderlab identity' ), findsNWidgets (2 ));
683672 await f.tap (tester, fullNpub (f.secondKeys.public)! );
684673 expect ((await f.store.read ())! .pubkey, f.secondKeys.public);
@@ -694,11 +683,8 @@ void main() {
694683 );
695684 f.rejectList = false ;
696685 await f.tap (tester, 'Try again' );
697- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
698- expect (f.probes, isEmpty);
699- await tester.tap (find.byType (CommunityGridOption ).first);
700- await f.settle (tester);
701- }
686+ expect (f.flow.stage, HostedFlowStage .idle);
687+ expect (f.probes, isEmpty);
702688 expect (
703689 find.text (
704690 'No communities available to add. Scan a QR code or use an invite link.' ,
@@ -711,11 +697,10 @@ void main() {
711697 // Account restoration may resume independently of the Add choices.
712698 await f.flow.signInAccount ();
713699 await f.settle (tester);
714- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
715- expect (f.probes, isEmpty);
716- await tester.tap (find.byType (CommunityGridOption ).first);
717- await f.settle (tester);
718- }
700+ expect (f.flow.stage, HostedFlowStage .chooseCommunities);
701+ expect (f.probes, isEmpty);
702+ await tester.tap (find.byType (CommunityGridOption ).first);
703+ await f.settle (tester);
719704 // Continue explicitly admits the selected communities.
720705 expect (find.byType (CheckboxListTile ).hitTestable (), findsNothing);
721706 expect (
@@ -776,11 +761,10 @@ void main() {
776761 // Account restoration may resume independently of the Add choices.
777762 await f.flow.signInAccount ();
778763 await f.settle (tester);
779- if (f.flow.stage == HostedFlowStage .chooseCommunities) {
780- expect (f.probes, isEmpty);
781- await tester.tap (find.byType (CommunityGridOption ).last);
782- await f.settle (tester);
783- }
764+ expect (f.flow.stage, HostedFlowStage .chooseCommunities);
765+ expect (f.probes, isEmpty);
766+ await tester.tap (find.byType (CommunityGridOption ).last);
767+ await f.settle (tester);
784768 // All memberships are restored; the second is the chosen destination.
785769 expect (f.profileWrites, isEmpty);
786770 expect (
0 commit comments