Skip to content

Commit

Permalink
inbox test: Set up whole ZulipApp, not just MaterialApp
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chrisbobbe committed Jun 20, 2024
1 parent ae0cfc8 commit 398ab4e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/widgets/inbox_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:zulip/api/model/events.dart';
import 'package:zulip/api/model/model.dart';
import 'package:zulip/model/store.dart';
import 'package:zulip/widgets/app.dart';
import 'package:zulip/widgets/icons.dart';
import 'package:zulip/widgets/inbox.dart';
import 'package:zulip/widgets/store.dart';

import '../example_data.dart' as eg;
import '../flutter_checks.dart';
Expand Down Expand Up @@ -71,12 +71,10 @@ void main() {
}

await tester.pumpWidget(
GlobalStoreWidget(
child: MaterialApp(
navigatorObservers: [if (navigatorObserver != null) navigatorObserver],
home: PerAccountStoreWidget(
accountId: eg.selfAccount.id,
child: const InboxPage()))));
ZulipApp(navigatorObservers: [if (navigatorObserver != null) navigatorObserver]));
await tester.pump();
final navigator = await ZulipApp.navigator;
navigator.push(InboxPage.buildRoute(accountId: eg.selfAccount.id));

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

0 comments on commit 398ab4e

Please sign in to comment.