Skip to content

Commit 0ae0139

Browse files
committed
emoji_reaction test: Set up text direction more realistically
1 parent a3e3ac1 commit 0ae0139

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

test/widgets/emoji_reaction_test.dart

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,26 @@ void main() {
4646
}) async {
4747
final message = eg.streamMessage(reactions: reactions);
4848

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+
4958
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
50-
child: Directionality(
51-
textDirection: textDirection,
52-
child: Center(
53-
child: ColoredBox(
54-
color: Colors.white,
55-
child: SizedBox(
56-
width: width,
57-
child: ReactionChipsList(
58-
messageId: message.id,
59-
reactions: message.reactions!,
60-
)))))));
61-
62-
// global store, per-account store
63-
await tester.pumpAndSettle();
59+
child: Center(
60+
child: ColoredBox(
61+
color: Colors.white,
62+
child: SizedBox(
63+
width: width,
64+
child: ReactionChipsList(
65+
messageId: message.id,
66+
reactions: message.reactions!,
67+
))))));
68+
await tester.pumpAndSettle(); // global store, per-account store
6469

6570
final reactionChipsList = tester.element(find.byType(ReactionChipsList));
6671
check(Directionality.of(reactionChipsList)).equals(textDirection);

0 commit comments

Comments
 (0)