Skip to content

Commit 78d6d96

Browse files
committed
inbox test: Set up whole ZulipApp, not just MaterialApp
This should help the tests be more representative generally; but in particular, ZulipApp is going to start providing the stream color swatches, instead of code in api/model, for zulip#393. So, we have the test setup use ZulipApp so that we don't get a crash in InboxPage. Related: zulip#393
1 parent 8b6da29 commit 78d6d96

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/widgets/inbox_test.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import 'package:flutter_test/flutter_test.dart';
44
import 'package:zulip/api/model/events.dart';
55
import 'package:zulip/api/model/model.dart';
66
import 'package:zulip/model/store.dart';
7+
import 'package:zulip/widgets/app.dart';
78
import 'package:zulip/widgets/icons.dart';
89
import 'package:zulip/widgets/inbox.dart';
9-
import 'package:zulip/widgets/store.dart';
1010

1111
import '../example_data.dart' as eg;
1212
import '../flutter_checks.dart';
@@ -71,12 +71,10 @@ void main() {
7171
}
7272

7373
await tester.pumpWidget(
74-
GlobalStoreWidget(
75-
child: MaterialApp(
76-
navigatorObservers: [if (navigatorObserver != null) navigatorObserver],
77-
home: PerAccountStoreWidget(
78-
accountId: eg.selfAccount.id,
79-
child: const InboxPage()))));
74+
ZulipApp(navigatorObservers: [if (navigatorObserver != null) navigatorObserver]));
75+
await tester.pump();
76+
final navigator = await ZulipApp.navigator;
77+
navigator.push(InboxPage.buildRoute(accountId: eg.selfAccount.id));
8078

8179
// global store and per-account store get loaded
8280
await tester.pumpAndSettle();

0 commit comments

Comments
 (0)