@@ -42,19 +42,9 @@ void main() {
42
42
Future <void > setupChipsInBox (WidgetTester tester, {
43
43
required List <Reaction > reactions,
44
44
double width = 245.0 , // (seen in context on an iPhone 13 Pro)
45
- TextDirection textDirection = TextDirection .ltr,
46
45
}) async {
47
46
final message = eg.streamMessage (reactions: reactions);
48
47
49
- final locale = switch (textDirection) {
50
- TextDirection .ltr => const Locale ('en' ),
51
- TextDirection .rtl => const Locale ('ar' ),
52
- };
53
- tester.platformDispatcher.localeTestValue = locale;
54
- tester.platformDispatcher.localesTestValue = [locale];
55
- addTearDown (tester.platformDispatcher.clearLocaleTestValue);
56
- addTearDown (tester.platformDispatcher.clearLocalesTestValue);
57
-
58
48
await tester.pumpWidget (TestZulipApp (accountId: eg.selfAccount.id,
59
49
child: Center (
60
50
child: ColoredBox (
@@ -68,7 +58,6 @@ void main() {
68
58
await tester.pumpAndSettle (); // global store, per-account store
69
59
70
60
final reactionChipsList = tester.element (find.byType (ReactionChipsList ));
71
- check (Directionality .of (reactionChipsList)).equals (textDirection);
72
61
check (reactionChipsList).size.isNotNull ().width.equals (width);
73
62
}
74
63
@@ -106,6 +95,15 @@ void main() {
106
95
tester.platformDispatcher.textScaleFactorTestValue = textScaleFactor;
107
96
addTearDown (tester.platformDispatcher.clearTextScaleFactorTestValue);
108
97
98
+ final locale = switch (textDirection) {
99
+ TextDirection .ltr => const Locale ('en' ),
100
+ TextDirection .rtl => const Locale ('ar' ),
101
+ };
102
+ tester.platformDispatcher.localeTestValue = locale;
103
+ tester.platformDispatcher.localesTestValue = [locale];
104
+ addTearDown (tester.platformDispatcher.clearLocaleTestValue);
105
+ addTearDown (tester.platformDispatcher.clearLocalesTestValue);
106
+
109
107
await prepare ();
110
108
111
109
await store.addUsers (users);
@@ -126,7 +124,10 @@ void main() {
126
124
..statusCode = HttpStatus .ok
127
125
..content = kSolidBlueAvatar;
128
126
129
- await setupChipsInBox (tester, textDirection: textDirection, reactions: reactions);
127
+ await setupChipsInBox (tester, reactions: reactions);
128
+
129
+ final reactionChipsList = tester.element (find.byType (ReactionChipsList ));
130
+ check (Directionality .of (reactionChipsList)).equals (textDirection);
130
131
131
132
// TODO(upstream) Do these in an addTearDown, once we can:
132
133
// https://github.com/flutter/flutter/issues/123189
0 commit comments