Show Reddit post age in conversations
This commit is contained in:
1 parent
7db60e8839
commit
50f9f8a6aa
14 files changed
+65
-11
No files matched your search
@@ -31,6 +31,7 @@ describe('PostsRepository', () => {
|
||||
title: 'Test Post',
|
||||
postUrl: 'https://www.reddit.com/r/test/comments/post1/test_post/',
|
||||
imageUrl: 'http://example.com/img.jpg',
|
||||
postCreatedAt: 1_700_000_000_000,
|
||||
processedAt: Date.now(),
|
||||
});
|
||||
|
||||
@@ -42,6 +43,7 @@ describe('PostsRepository', () => {
|
||||
expect(post!.title).toBe('Test Post');
|
||||
expect(post!.postUrl).toBe('https://www.reddit.com/r/test/comments/post1/test_post/');
|
||||
expect(post!.imageUrl).toBe('http://example.com/img.jpg');
|
||||
expect(post!.postCreatedAt).toBe(1_700_000_000_000);
|
||||
expect(post!.messageSent).toBe(false);
|
||||
expect(post!.imageAnalysis).toBeNull();
|
||||
expect(post!.error).toBeNull();
|
||||
@@ -314,6 +316,7 @@ describe('MessagesRepository', () => {
|
||||
title: 'Second post',
|
||||
postUrl: 'https://www.reddit.com/r/gonewild/comments/post-b/second_post/',
|
||||
imageUrl: null,
|
||||
postCreatedAt: 1_700_000_000_000,
|
||||
processedAt: Date.now(),
|
||||
});
|
||||
|
||||
@@ -327,6 +330,7 @@ describe('MessagesRepository', () => {
|
||||
expect(latest!.subreddit).toBe('gonewild');
|
||||
expect(latest!.postTitle).toBe('Second post');
|
||||
expect(latest!.postUrl).toBe('https://www.reddit.com/r/gonewild/comments/post-b/second_post/');
|
||||
expect(latest!.postCreatedAt).toBe(1_700_000_000_000);
|
||||
expect(messagesRepo.getByChatRoomId('room-b')).toMatchObject({ postId: 'post-b', postTitle: 'Second post' });
|
||||
|
||||
expect(messagesRepo.getLatestByRecipient('ALICE')).toBeDefined();
|
||||
|
||||
Reference in new issue
Block a user