Skip to content

Commit e67af6a

Browse files
committed
action_sheet test: Cut assumption of topic recipient header in topic narrow
With zulip#1039 "Fuse recipient header into app bar for topic narrows", this setup will likely become invalid. It assumes that a topic recipient header can be found in a topic-narrow message list. Switching to the combined-feed narrow would break tests that use a muted topic, because the topic's message(s) are excluded in that narrow, so there wouldn't be a recipient header to tap. Instead, trigger the topic action sheet from the topic-narrow app bar.
1 parent 22f6798 commit e67af6a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,7 @@ void main() {
277277

278278
final message = eg.streamMessage(
279279
stream: someChannel, topic: topic, sender: eg.otherUser);
280-
connection.prepare(json: eg.newestGetMessagesResult(
281-
foundOldest: true, messages: [message]).toJson());
282-
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
283-
child: MessageListPage(
284-
initNarrow: eg.topicNarrow(someChannel.streamId, topic))));
285-
await tester.pumpAndSettle();
286-
287-
await tester.longPress(find.descendant(
288-
of: find.byType(RecipientHeader), matching: find.text(topic)));
289-
// sheet appears onscreen; default duration of bottom-sheet enter animation
290-
await tester.pump(const Duration(milliseconds: 250));
280+
await showFromAppBar(tester, channel: someChannel, topic: topic, message: message);
291281
}
292282

293283
void checkButtons(List<Finder> expectedButtonFinders) {

0 commit comments

Comments
 (0)