Skip to content

Commit 33c0dbf

Browse files
topic list: Update tests for channelTopicLabelSpan behavior.
1 parent 65a15cd commit 33c0dbf

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void main() {
199199
await tester.pump();
200200
check(find.byType(InboxPageBody)).findsOne();
201201

202-
await tester.longPress(find.text(someChannel.name).hitTestable());
202+
await tester.longPress(find.textContaining(someChannel.name, findRichText: true).hitTestable());
203203
await tester.pump(const Duration(milliseconds: 250));
204204
}
205205

@@ -211,7 +211,7 @@ void main() {
211211
await tester.pump();
212212
check(find.byType(SubscriptionListPageBody)).findsOne();
213213

214-
await tester.longPress(find.text(someChannel.name).hitTestable());
214+
await tester.longPress(find.textContaining(someChannel.name, findRichText: true).hitTestable());
215215
await tester.pump(const Duration(milliseconds: 250));
216216
}
217217

@@ -236,7 +236,7 @@ void main() {
236236

237237
await tester.longPress(find.descendant(
238238
of: find.byType(ZulipAppBar),
239-
matching: find.text(channel.name)));
239+
matching: find.textContaining(channel.name, findRichText: true)));
240240
await tester.pump(const Duration(milliseconds: 250));
241241
}
242242

@@ -253,7 +253,7 @@ void main() {
253253

254254
await tester.longPress(find.descendant(
255255
of: find.byType(RecipientHeader),
256-
matching: find.text(message.displayRecipient ?? '')));
256+
matching: find.textContaining(message.displayRecipient ?? '', findRichText: true)));
257257
await tester.pump(const Duration(milliseconds: 250));
258258
}
259259

test/widgets/topic_list_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ void main() {
8888
await tester.pump();
8989
await tester.pump(Duration.zero);
9090
check(find.descendant(
91-
of: find.byType(MessageListPage),
92-
matching: find.text('channel foo')),
91+
of: find.descendant(
92+
of: find.byType(MessageListPage),
93+
matching: find.byType(ZulipAppBar)),
94+
matching: find.textContaining('channel foo', findRichText: true)),
9395
).findsOne();
9496
});
9597

0 commit comments

Comments
 (0)