Fix show author name in last message of pending invites in chat list (#668)
* fix: show author name in last message of pending invites in chat list * docs: update changelog
This commit is contained in:
@@ -408,6 +408,37 @@ void main() {
|
||||
expect(item.subtitle, 'Look at this');
|
||||
expect(item.subtitleIcon, isNull);
|
||||
});
|
||||
|
||||
testWidgets('shows "You: " prefix for own message in pending group', (tester) async {
|
||||
await pumpTile(
|
||||
tester,
|
||||
_chatSummary(
|
||||
pendingConfirmation: true,
|
||||
lastMessageContent: 'My message',
|
||||
lastMessageAuthor: testPubkeyA,
|
||||
),
|
||||
);
|
||||
final item = tester.widget<WnChatListItem>(find.byType(WnChatListItem));
|
||||
expect(item.prefixSubtitle, 'You: ');
|
||||
expect(item.subtitle, 'My message');
|
||||
});
|
||||
|
||||
testWidgets("shows author name prefix for other's message in pending group", (
|
||||
tester,
|
||||
) async {
|
||||
await pumpTile(
|
||||
tester,
|
||||
_chatSummary(
|
||||
pendingConfirmation: true,
|
||||
lastMessageContent: 'Hello group',
|
||||
lastMessageAuthor: testPubkeyB,
|
||||
lastMessageAuthorDisplayName: 'Alice',
|
||||
),
|
||||
);
|
||||
final item = tester.widget<WnChatListItem>(find.byType(WnChatListItem));
|
||||
expect(item.prefixSubtitle, 'Alice: ');
|
||||
expect(item.subtitle, 'Hello group');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user