Skip to content

msglist test: Wait through a nav-transition animation in a place we forgot #1761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions test/widgets/message_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2135,16 +2135,14 @@ void main() {
});

testWidgets('hidden -> failed, tapping does nothing if compose box is not offered', (tester) async {
Route<dynamic>? lastPoppedRoute;
final navObserver = TestNavigatorObserver()
..onPopped = (route, prevRoute) => lastPoppedRoute = route;
final transitionDurationObserver = TransitionDurationObserver();

final messages = [eg.streamMessage(
stream: stream, topic: topic, content: content)];
await setupMessageListPage(tester,
narrow: const CombinedFeedNarrow(),
streams: [stream], subscriptions: [eg.subscription(stream)],
navObservers: [navObserver],
navObservers: [transitionDurationObserver],
messages: messages);

// Navigate to a message list page in a topic narrow,
Expand All @@ -2153,7 +2151,7 @@ void main() {
eg.newestGetMessagesResult(foundOldest: true, messages: messages).toJson());
await tester.tap(find.widgetWithText(RecipientHeader, topic));
await tester.pump(); // handle tap
await tester.pump(); // wait for navigation
await transitionDurationObserver.pumpPastTransition(tester);
check(contentInputFinder).findsOne();

await sendMessageAndFail(tester);
Expand All @@ -2162,12 +2160,8 @@ void main() {
// where the failed to send message should be visible.

await tester.pageBack();
check(lastPoppedRoute)
.isA<MaterialAccountWidgetRoute>().page
.isA<MessageListPage>()
.initNarrow.equals(TopicNarrow(stream.streamId, eg.t(topic)));
await tester.pump(); // handle tap
await tester.pump((lastPoppedRoute as TransitionRoute).reverseTransitionDuration);
await transitionDurationObserver.pumpPastTransition(tester);
check(contentInputFinder).findsNothing();
check(messageNotSentFinder).findsOne();

Expand Down
Loading