Skip to content

Commit 6795e96

Browse files
chrisbobbegnprice
authored andcommitted
action_sheet test: Support channel action sheet tests with unknown channel
1 parent 8d43acf commit 6795e96

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,21 @@ void main() {
255255
await tester.pump(const Duration(milliseconds: 250));
256256
}
257257

258-
Future<void> showFromTopicListAppBar(WidgetTester tester) async {
258+
Future<void> showFromTopicListAppBar(WidgetTester tester, {int? streamId}) async {
259+
streamId ??= someChannel.streamId;
259260
final transitionDurationObserver = TransitionDurationObserver();
260261

261262
connection.prepare(json: GetStreamTopicsResult(topics: []).toJson());
262263
await tester.pumpWidget(TestZulipApp(
263264
navigatorObservers: [transitionDurationObserver],
264265
accountId: eg.selfAccount.id,
265-
child: TopicListPage(streamId: someChannel.streamId)));
266+
child: TopicListPage(streamId: streamId)));
266267
await tester.pump();
267268

269+
final titleText = store.streams[streamId]?.name ?? '(unknown channel)';
268270
await tester.longPress(find.descendant(
269271
of: find.byType(ZulipAppBar),
270-
matching: find.text(someChannel.name)));
272+
matching: find.text(titleText)));
271273
await transitionDurationObserver.pumpPastTransition(tester);
272274
}
273275

0 commit comments

Comments
 (0)