fix: Improve plugin ui entry points, Fix chat scroll, fix notifications, fix user rights
This commit is contained in:
@@ -2,6 +2,8 @@ import {
|
||||
advanceDirectMessageStatus,
|
||||
createDirectConversation,
|
||||
createGroupConversation,
|
||||
directMessageEventIncludesUser,
|
||||
directMessageSyncIncludesUser,
|
||||
getDirectConversationId,
|
||||
isGroupDirectConversation,
|
||||
updateMessageStatusInConversation,
|
||||
@@ -92,6 +94,30 @@ describe('DirectMessageService domain flow', () => {
|
||||
expect(advanceDirectMessageStatus('DELIVERED', 'SENT')).toBe('DELIVERED');
|
||||
expect(advanceDirectMessageStatus('DELIVERED', 'ACKNOWLEDGED')).toBe('ACKNOWLEDGED');
|
||||
});
|
||||
|
||||
it('recognises only declared direct-message recipients and participants', () => {
|
||||
const payload = {
|
||||
message: createMessage('message-1', 'SENT', 'dm-group-test', ['bob']),
|
||||
participants: [alice, bob],
|
||||
sender: alice
|
||||
};
|
||||
|
||||
expect(directMessageEventIncludesUser(payload, 'bob')).toBe(true);
|
||||
expect(directMessageEventIncludesUser(payload, 'charlie')).toBe(false);
|
||||
});
|
||||
|
||||
it('recognises only declared sync participants', () => {
|
||||
const payload = {
|
||||
conversationId: 'dm-group-test',
|
||||
messages: [],
|
||||
participants: [alice, bob],
|
||||
sender: alice,
|
||||
syncedAt: 30
|
||||
};
|
||||
|
||||
expect(directMessageSyncIncludesUser(payload, 'alice')).toBe(true);
|
||||
expect(directMessageSyncIncludesUser(payload, 'charlie')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
function createMessage(
|
||||
|
||||
Reference in New Issue
Block a user