Skip to content

Commit 040478a

Browse files
TW-2389 Turn format ci back on (#2876)
1 parent 5550dee commit 040478a

File tree

877 files changed

+23196
-29033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

877 files changed

+23196
-29033
lines changed

integration_test/base/core_robot.dart

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ class CoreRobot {
108108
final end = DateTime.now().add(timeout);
109109

110110
while (DateTime.now().isBefore(end)) {
111-
final views = await $.native.getNativeViews(
112-
selector,
113-
appId: appId,
114-
);
111+
final views = await $.native.getNativeViews(selector, appId: appId);
115112
if (views.isEmpty) return;
116113

117114
await Future.delayed(interval);
@@ -178,15 +175,18 @@ class CoreRobot {
178175
Object? err;
179176
final done = Completer<void>();
180177

181-
runZonedGuarded(() async {
182-
try {
183-
await body();
184-
} finally {
185-
done.complete();
186-
}
187-
}, (e, _) {
188-
err ??= e; // store the first error
189-
});
178+
runZonedGuarded(
179+
() async {
180+
try {
181+
await body();
182+
} finally {
183+
done.complete();
184+
}
185+
},
186+
(e, _) {
187+
err ??= e; // store the first error
188+
},
189+
);
190190

191191
await done.future;
192192
return err?.toString();
@@ -347,15 +347,16 @@ class CoreRobot {
347347
thirdRequest.headers
348348
..set('Sec-Fetch-Mode', 'navigate')
349349
..set(
350-
HttpHeaders.refererHeader,
351-
'https://$ssoURL/oauth2/authorize?response_type=code'
352-
'&client_id=$clientId'
353-
'&redirect_uri=$redirectUriValue'
354-
'&scope=$scope'
355-
'&state=$state'
356-
'&nonce=$nonce'
357-
'&code_challenge_method=$codeChallengeMethod'
358-
'&code_challenge=$codeChallenge')
350+
HttpHeaders.refererHeader,
351+
'https://$ssoURL/oauth2/authorize?response_type=code'
352+
'&client_id=$clientId'
353+
'&redirect_uri=$redirectUriValue'
354+
'&scope=$scope'
355+
'&state=$state'
356+
'&nonce=$nonce'
357+
'&code_challenge_method=$codeChallengeMethod'
358+
'&code_challenge=$codeChallenge',
359+
)
359360
..set('Sec-Fetch-Site', 'same-origin')
360361
..set(HttpHeaders.acceptLanguageHeader, 'en-US,en;q=0.9,vi;q=0.8')
361362
..set('Origin', 'https://$ssoURL')
@@ -407,8 +408,9 @@ class CoreRobot {
407408
(cookie) => cookie.contains('lemonldap='),
408409
orElse: () => '',
409410
);
410-
final matchOfThirdResponse =
411-
RegExp(r'lemonldap=([^&;]+)').firstMatch(oidcCookieOfThirdResponse);
411+
final matchOfThirdResponse = RegExp(
412+
r'lemonldap=([^&;]+)',
413+
).firstMatch(oidcCookieOfThirdResponse);
412414
lemonldap = matchOfThirdResponse?.group(1);
413415

414416
// Step 7: Call OIDC callback to get loginToken
@@ -487,10 +489,7 @@ class CoreRobot {
487489
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
488490
)
489491
..set('Sec-Fetch-Dest', 'empty')
490-
..set(
491-
HttpHeaders.cookieHeader,
492-
'lemonldap=$lemonldap',
493-
);
492+
..set(HttpHeaders.cookieHeader, 'lemonldap=$lemonldap');
494493

495494
fifthRequest.write(
496495
jsonEncode({
@@ -545,17 +544,9 @@ class CoreRobot {
545544
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
546545
)
547546
..set('Sec-Fetch-Dest', 'empty')
548-
..set(
549-
HttpHeaders.cookieHeader,
550-
'lemonldap=$lemonldap',
551-
);
547+
..set(HttpHeaders.cookieHeader, 'lemonldap=$lemonldap');
552548

553-
sixthRequest.write(
554-
jsonEncode({
555-
'msgtype': 'm.text',
556-
'body': message,
557-
}),
558-
);
549+
sixthRequest.write(jsonEncode({'msgtype': 'm.text', 'body': message}));
559550

560551
await sixthRequest.close();
561552
}
@@ -573,10 +564,7 @@ class CoreRobot {
573564
final PatrolFinder scrollable = root == null
574565
? $(Scrollable).first
575566
: $(
576-
find.descendant(
577-
of: root.finder,
578-
matching: find.byType(Scrollable),
579-
),
567+
find.descendant(of: root.finder, matching: find.byType(Scrollable)),
580568
).first;
581569

582570
var lastPixels = -1.0;
@@ -602,10 +590,7 @@ class CoreRobot {
602590
final PatrolFinder scrollable = root == null
603591
? $(Scrollable).first
604592
: $(
605-
find.descendant(
606-
of: root.finder,
607-
matching: find.byType(Scrollable),
608-
),
593+
find.descendant(of: root.finder, matching: find.byType(Scrollable)),
609594
).first;
610595

611596
for (var i = 0; i < maxDrags; i++) {
@@ -652,10 +637,7 @@ class CoreRobot {
652637
final scrollableFinder = root == null
653638
? $(Scrollable)
654639
: $(
655-
find.descendant(
656-
of: root.finder,
657-
matching: find.byType(Scrollable),
658-
),
640+
find.descendant(of: root.finder, matching: find.byType(Scrollable)),
659641
);
660642

661643
return scrollableFinder.exists;

integration_test/base/test_base.dart

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ class TestBase {
4848
const defaultNativeConfig = NativeAutomatorConfig(
4949
findTimeout: Duration(milliseconds: nativeFindTimeoutMs),
5050
);
51-
patrolTest(description,
52-
timeout: testTimeout,
53-
config: patrolConfig,
54-
nativeAutomatorConfig: nativeAutomatorConfig ?? defaultNativeConfig,
55-
tags: tags,
56-
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.fullyLive,
57-
($) async {
58-
await initTwakeChat();
59-
final originalOnError = FlutterError.onError!;
60-
FlutterError.onError = (FlutterErrorDetails details) {
61-
originalOnError(details);
62-
};
63-
await loginAndRun($);
64-
await test($);
65-
});
51+
patrolTest(
52+
description,
53+
timeout: testTimeout,
54+
config: patrolConfig,
55+
nativeAutomatorConfig: nativeAutomatorConfig ?? defaultNativeConfig,
56+
tags: tags,
57+
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.fullyLive,
58+
($) async {
59+
await initTwakeChat();
60+
final originalOnError = FlutterError.onError!;
61+
FlutterError.onError = (FlutterErrorDetails details) {
62+
originalOnError(details);
63+
};
64+
await loginAndRun($);
65+
await test($);
66+
},
67+
);
6668
}
6769

6870
Future<void> initTwakeChat() async {
6971
app.main();
7072
}
7173

72-
Future<void> loginAndRun(
73-
PatrolIntegrationTester $,
74-
) async {
74+
Future<void> loginAndRun(PatrolIntegrationTester $) async {
7575
final loginScenario = LoginScenario(
7676
$,
7777
username: const String.fromEnvironment('USERNAME'),
@@ -87,28 +87,28 @@ class TestBase {
8787
required Function(PatrolIntegrationTester $) test,
8888
NativeAutomatorConfig? nativeAutomatorConfig,
8989
}) {
90-
patrolTest(description,
91-
config: const PatrolTesterConfig(
92-
printLogs: true,
93-
visibleTimeout: Duration(minutes: 1),
94-
),
95-
nativeAutomatorConfig:
96-
nativeAutomatorConfig ?? const NativeAutomatorConfig(),
97-
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.fullyLive,
98-
($) async {
99-
await initTwakeChat();
100-
final originalOnError = FlutterError.onError!;
101-
FlutterError.onError = (FlutterErrorDetails details) {
102-
originalOnError(details);
103-
};
104-
await login($);
105-
await test($);
106-
});
90+
patrolTest(
91+
description,
92+
config: const PatrolTesterConfig(
93+
printLogs: true,
94+
visibleTimeout: Duration(minutes: 1),
95+
),
96+
nativeAutomatorConfig:
97+
nativeAutomatorConfig ?? const NativeAutomatorConfig(),
98+
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.fullyLive,
99+
($) async {
100+
await initTwakeChat();
101+
final originalOnError = FlutterError.onError!;
102+
FlutterError.onError = (FlutterErrorDetails details) {
103+
originalOnError(details);
104+
};
105+
await login($);
106+
await test($);
107+
},
108+
);
107109
}
108110

109-
Future<void> login(
110-
PatrolIntegrationTester $,
111-
) async {
111+
Future<void> login(PatrolIntegrationTester $) async {
112112
final loginScenario = LoginScenario(
113113
$,
114114
username: const String.fromEnvironment('USERNAME'),

integration_test/extensions/default_flows.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,10 @@ extension DefaultFlowExtensions on WidgetTester {
154154
chatListFinder.evaluate().isEmpty);
155155

156156
if (homeserverPickerFinder.evaluate().isNotEmpty) {
157-
log(
158-
'Found HomeserverPicker, performing login.',
159-
name: 'Test Runner',
160-
);
157+
log('Found HomeserverPicker, performing login.', name: 'Test Runner');
161158
await tester.login();
162159
} else {
163-
log(
164-
'Found ChatListViewBody, skipping login.',
165-
name: 'Test Runner',
166-
);
160+
log('Found ChatListViewBody, skipping login.', name: 'Test Runner');
167161
}
168162

169163
await tester.acceptPushWarning();

integration_test/robots/add_member_robot.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ class AddMemberRobot extends CoreRobot {
3838
if (Platform.isAndroid) {
3939
return $(AlertDialog).$(TextButton).containing(find.text('YES'));
4040
} else {
41-
return $(CupertinoAlertDialog)
42-
.$(CupertinoDialogAction)
43-
.containing(find.text('Yes'));
41+
return $(
42+
CupertinoAlertDialog,
43+
).$(CupertinoDialogAction).containing(find.text('Yes'));
4444
}
4545
}
4646

4747
PatrolFinder getCancelnviteMemberBtn() {
4848
if (Platform.isAndroid) {
4949
return $(AlertDialog).$(TextButton).containing(find.text('CANCEL'));
5050
} else {
51-
return $(CupertinoAlertDialog)
52-
.$(CupertinoDialogAction)
53-
.containing(find.text('Cancel'));
51+
return $(
52+
CupertinoAlertDialog,
53+
).$(CupertinoDialogAction).containing(find.text('Cancel'));
5454
}
5555
}
5656

integration_test/robots/chat/chat_profile_info_robot.dart

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,25 @@ import '../../base/core_robot.dart';
88
class ChatProfileInfoRobot extends CoreRobot {
99
ChatProfileInfoRobot(super.$);
1010

11-
Future<void> verifyDisplayName({
12-
required String displayName,
13-
}) async {
11+
Future<void> verifyDisplayName({required String displayName}) async {
1412
final displayNameFinder = find.text(displayName);
1513
expect(displayNameFinder, findsOneWidget);
1614
}
1715

18-
Future<void> verifyDisplayMatrixId({
19-
required String matrixId,
20-
}) async {
16+
Future<void> verifyDisplayMatrixId({required String matrixId}) async {
2117
final matrixIdFinder = find.text(matrixId);
2218
expect(matrixIdFinder, findsOneWidget);
2319
}
2420

25-
Future<void> verifyEmail({
26-
required String email,
27-
}) async {
21+
Future<void> verifyEmail({required String email}) async {
2822
final emailFinder = find.text(email);
2923
if (email.isEmpty) {
3024
expect(emailFinder, findsNothing);
3125
return;
3226
}
3327
}
3428

35-
Future<void> verifyPhoneNumber({
36-
required String phoneNumber,
37-
}) async {
29+
Future<void> verifyPhoneNumber({required String phoneNumber}) async {
3830
final phoneNumberFinder = find.text(phoneNumber);
3931
if (phoneNumber.isEmpty) {
4032
expect(phoneNumberFinder, findsNothing);

integration_test/robots/chat_group_detail_robot.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ class ChatGroupDetailRobot extends CoreRobot {
5858
final ctx = $.tester.element(dialog); // BuildContext inside dialog
5959
final nextLabel = L10n.of(ctx)!.next; // whatever the app shows
6060

61-
await $.tester
62-
.tap(find.descendant(of: dialog, matching: find.text(nextLabel)));
61+
await $.tester.tap(
62+
find.descendant(of: dialog, matching: find.text(nextLabel)),
63+
);
6364
await $.tester.pumpAndSettle();
6465
}
6566
} catch (e) {

integration_test/robots/chat_list_robot.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ class ChatListRobot extends HomeRobot {
6969
}
7070

7171
TwakeListItemRobot getChatGroupByTitle(String title) {
72-
final finder = $(SlidableChatListItem)
73-
.containing($(ChatListItemTitle).containing($(title)));
72+
final finder = $(
73+
SlidableChatListItem,
74+
).containing($(ChatListItemTitle).containing($(title)));
7475
return TwakeListItemRobot($, finder);
7576
}
7677

integration_test/robots/group_information_robot.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ class GroupInformationRobot extends CoreRobot {
6161
final loadMoreTextFinder = find.byWidgetPredicate(
6262
(w) =>
6363
w is Text &&
64-
RegExp(r'^Load\s+\d+\s+more\s+participant(s)?$')
65-
.hasMatch(w.data ?? ''),
64+
RegExp(
65+
r'^Load\s+\d+\s+more\s+participant(s)?$',
66+
).hasMatch(w.data ?? ''),
6667
description: 'Load N more participants text',
6768
);
6869

@@ -126,9 +127,7 @@ class GroupInformationRobot extends CoreRobot {
126127
return $(find.byKey(ValueKey<String>(matrixID)));
127128
}
128129

129-
Future<void> openMemberDetail({
130-
required String matrixID,
131-
}) async {
130+
Future<void> openMemberDetail({required String matrixID}) async {
132131
await $.scrollUntilVisible(finder: getMemberByMatrixID(matrixID));
133132
await getMemberByMatrixID(matrixID).tap();
134133

0 commit comments

Comments
 (0)