@@ -20,6 +20,7 @@ import 'package:zulip/model/typing_status.dart';
20
20
import 'package:zulip/widgets/app.dart' ;
21
21
import 'package:zulip/widgets/color.dart' ;
22
22
import 'package:zulip/widgets/compose_box.dart' ;
23
+ import 'package:zulip/widgets/message_list.dart' ;
23
24
import 'package:zulip/widgets/page.dart' ;
24
25
import 'package:zulip/widgets/icons.dart' ;
25
26
import 'package:zulip/widgets/theme.dart' ;
@@ -69,15 +70,12 @@ void main() {
69
70
70
71
connection = store.connection as FakeApiConnection ;
71
72
73
+ connection.prepare (json:
74
+ eg.newestGetMessagesResult (foundOldest: true , messages: []).toJson ());
72
75
await tester.pumpWidget (TestZulipApp (accountId: selfAccount.id,
73
- child: Column (
74
- // This positions the compose box at the bottom of the screen,
75
- // simulating the layout of the message list page.
76
- children: [
77
- const Expanded (child: SizedBox .expand ()),
78
- ComposeBox (narrow: narrow),
79
- ])));
76
+ child: MessageListPage (initNarrow: narrow)));
80
77
await tester.pumpAndSettle ();
78
+ connection.takeRequests ();
81
79
82
80
controller = tester.state <ComposeBoxState >(find.byType (ComposeBox )).controller;
83
81
}
@@ -1334,13 +1332,22 @@ void main() {
1334
1332
await enterContent (tester, 'some content' );
1335
1333
checkContentInputValue (tester, 'some content' );
1336
1334
1335
+ // Encache a new connection; prepare it for the message-list fetch
1336
+ final newConnection = (testBinding.globalStore
1337
+ ..clearCachedApiConnections ()
1338
+ ..useCachedApiConnections = true )
1339
+ .apiConnectionFromAccount (store.account) as FakeApiConnection ;
1340
+ newConnection.prepare (json:
1341
+ eg.newestGetMessagesResult (foundOldest: true , messages: []).toJson ());
1342
+
1337
1343
store.updateMachine!
1338
1344
..debugPauseLoop ()
1339
1345
..poll ()
1340
1346
..debugPrepareLoopError (
1341
1347
eg.apiExceptionBadEventQueueId (queueId: store.queueId))
1342
1348
..debugAdvanceLoop ();
1343
1349
await tester.pump ();
1350
+ await tester.pump (Duration .zero);
1344
1351
1345
1352
final newStore = testBinding.globalStore.perAccountSync (store.accountId)! ;
1346
1353
check (newStore)
0 commit comments