Skip to content

Commit 11af890

Browse files
chrisbobbegithub-actions[bot]
authored andcommitted
action_sheet test: Cut assumption of topic recipient header in topic narrow
With #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 47fe852 commit 11af890

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
@@ -274,17 +274,7 @@ void main() {
274274

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

290280
void checkButtons(List<Finder> expectedButtonFinders) {

0 commit comments

Comments
 (0)