@@ -10,8 +10,9 @@ import 'package:flutter_test/flutter_test.dart';
10
10
import 'package:zulip/api/model/events.dart' ;
11
11
import 'package:zulip/api/model/model.dart' ;
12
12
import 'package:zulip/model/store.dart' ;
13
+ import 'package:zulip/widgets/app.dart' ;
13
14
import 'package:zulip/widgets/emoji_reaction.dart' ;
14
- import 'package:zulip/widgets/store .dart' ;
15
+ import 'package:zulip/widgets/page .dart' ;
15
16
16
17
import '../example_data.dart' as eg;
17
18
import '../flutter_checks.dart' ;
@@ -46,25 +47,28 @@ void main() {
46
47
}) async {
47
48
final message = eg.streamMessage (reactions: reactions);
48
49
49
- await tester.pumpWidget (
50
- MaterialApp (
51
- home: Directionality (
52
- textDirection: textDirection,
53
- child: GlobalStoreWidget (
54
- child: PerAccountStoreWidget (
55
- accountId: eg.selfAccount.id,
56
- child: Center (
57
- child: ColoredBox (
58
- color: Colors .white,
59
- child: SizedBox (
60
- width: width,
61
- child: ReactionChipsList (
62
- messageId: message.id,
63
- reactions: message.reactions! ,
64
- )))))))));
65
-
66
- // global store, per-account store
67
- await tester.pumpAndSettle ();
50
+ final locale = switch (textDirection) {
51
+ TextDirection .ltr => const Locale ('en' ),
52
+ TextDirection .rtl => const Locale ('ar' ),
53
+ };
54
+ tester.platformDispatcher.localeTestValue = locale;
55
+ tester.platformDispatcher.localesTestValue = [locale];
56
+ addTearDown (tester.platformDispatcher.clearLocaleTestValue);
57
+ addTearDown (tester.platformDispatcher.clearLocalesTestValue);
58
+
59
+ await tester.pumpWidget (const ZulipApp ());
60
+ await tester.pump ();
61
+ final navigator = await ZulipApp .navigator;
62
+ navigator.push (MaterialAccountWidgetRoute (accountId: eg.selfAccount.id, page: Center (
63
+ child: ColoredBox (
64
+ color: Colors .white,
65
+ child: SizedBox (
66
+ width: width,
67
+ child: ReactionChipsList (
68
+ messageId: message.id,
69
+ reactions: message.reactions! ,
70
+ ))))));
71
+ await tester.pumpAndSettle (); // global store, per-account store
68
72
69
73
final reactionChipsList = tester.element (find.byType (ReactionChipsList ));
70
74
check (Directionality .of (reactionChipsList)).equals (textDirection);
0 commit comments