Skip to content

Commit 3b5f5ca

Browse files
committed
msglist test: Make new DmRecpientHeader group; move two tests into it
A counterpart to the StreamMessageRecipientHeader group.
1 parent afaf8f3 commit 3b5f5ca

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

test/widgets/message_list_test.dart

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -368,35 +368,37 @@ void main() {
368368
});
369369
});
370370

371-
testWidgets('show names on DMs', (tester) async {
372-
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
373-
await setupMessageListPage(tester, messages: [
374-
eg.dmMessage(from: eg.selfUser, to: []),
375-
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]),
376-
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser, eg.otherUser]),
377-
]);
378-
store.addUser(eg.otherUser);
379-
store.addUser(eg.thirdUser);
380-
await tester.pump();
381-
tester.widget(find.text(zulipLocalizations.messageListGroupYouWithYourself));
382-
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
383-
eg.otherUser.fullName)));
384-
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
385-
"${eg.otherUser.fullName}, ${eg.thirdUser.fullName}")));
386-
});
371+
group('DmRecipientHeader', () {
372+
testWidgets('show names', (tester) async {
373+
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
374+
await setupMessageListPage(tester, messages: [
375+
eg.dmMessage(from: eg.selfUser, to: []),
376+
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]),
377+
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser, eg.otherUser]),
378+
]);
379+
store.addUser(eg.otherUser);
380+
store.addUser(eg.thirdUser);
381+
await tester.pump();
382+
tester.widget(find.text(zulipLocalizations.messageListGroupYouWithYourself));
383+
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
384+
eg.otherUser.fullName)));
385+
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
386+
"${eg.otherUser.fullName}, ${eg.thirdUser.fullName}")));
387+
});
387388

388-
testWidgets('show names on DMs: smoothly handle unknown users', (tester) async {
389-
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
390-
await setupMessageListPage(tester, messages: [
391-
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]),
392-
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser, eg.otherUser]),
393-
]);
394-
store.addUser(eg.thirdUser);
395-
await tester.pump();
396-
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
397-
zulipLocalizations.unknownUserName)));
398-
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
399-
"${zulipLocalizations.unknownUserName}, ${eg.thirdUser.fullName}")));
389+
testWidgets('show names: smoothly handle unknown users', (tester) async {
390+
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
391+
await setupMessageListPage(tester, messages: [
392+
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]),
393+
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser, eg.otherUser]),
394+
]);
395+
store.addUser(eg.thirdUser);
396+
await tester.pump();
397+
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
398+
zulipLocalizations.unknownUserName)));
399+
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
400+
"${zulipLocalizations.unknownUserName}, ${eg.thirdUser.fullName}")));
401+
});
400402
});
401403

402404
testWidgets('show dates', (tester) async {

0 commit comments

Comments
 (0)