Treat Telegram references as seller signals

This commit is contained in:
jjbrunton committed 2026-08-09 17:09:41 +01:00
1 parent dc3fc6373b
commit f98c5c732d
6 files changed
+27 -2

No files matched your search

+16
View File
@@ -304,6 +304,22 @@ describe('RedditApiClient', () => {
expect(get).not.toHaveBeenCalled();
});
it('treats a Telegram reference in the current post as a seller signal', async () => {
const get = vi.fn();
vi.mocked(axios.create).mockReturnValue({ get } as any);
const client2 = new RedditApiClient(getTestConfig(), logger);
const post = {
id: 'post-telegram', name: 't3_post-telegram', subreddit: 'test', author: 'testuser',
title: 'Message me there', selftext: 'More content on t.me/example',
url: 'https://reddit.com/post-telegram', permalink: '/r/test/post-telegram', thumbnail: '',
is_self: true, created_utc: 1, over_18: true, spoiler: false,
};
await expect(client2.isSellerProfile('testuser', ['telegram'], ['t.me', 'telegram.me'], post))
.resolves.toBe(true);
expect(get).not.toHaveBeenCalled();
});
it('detects seller signals in recent profile activity when the bio is clean', async () => {
const get = vi.fn()
.mockResolvedValueOnce({ data: { data: { subreddit: { public_description: 'Just me' } } } })