fix: solve small pm chat ui issues
unwrap the pill fix the fetching images in pm not auto download
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { getWatchedAttachmentRoomIdFromUrl, isDirectMessageAttachmentRoomId } from './attachment.logic';
|
||||
|
||||
describe('attachment logic', () => {
|
||||
it('extracts watched server room ids from room URLs', () => {
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/room/general')).toBe('general');
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/room/general/chat')).toBe('general');
|
||||
});
|
||||
|
||||
it('extracts watched direct-message storage ids from DM URLs', () => {
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/dm/alice%3Abob')).toBe('direct-message:alice:bob');
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/pm/dm-group-1?tab=chat')).toBe('direct-message:dm-group-1');
|
||||
});
|
||||
|
||||
it('ignores non-message URLs', () => {
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/settings')).toBeNull();
|
||||
expect(getWatchedAttachmentRoomIdFromUrl('/dm')).toBeNull();
|
||||
});
|
||||
|
||||
it('identifies direct-message attachment storage ids', () => {
|
||||
expect(isDirectMessageAttachmentRoomId('direct-message:alice:bob')).toBe(true);
|
||||
expect(isDirectMessageAttachmentRoomId('room-1')).toBe(false);
|
||||
expect(isDirectMessageAttachmentRoomId(null)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user