Treat Telegram references as seller signals
This commit is contained in:
1 parent
dc3fc6373b
commit
f98c5c732d
6 files changed
+27
-2
No files matched your search
@@ -155,6 +155,9 @@ describe('ConfigSchema', () => {
|
||||
if (result.success) {
|
||||
expect(result.data.reddit.sellerKeywords.length).toBeGreaterThan(0);
|
||||
expect(result.data.reddit.sellerKeywords).toContain('onlyfans');
|
||||
expect(result.data.reddit.sellerKeywords).toContain('telegram');
|
||||
expect(result.data.reddit.sellerDomains).toContain('t.me');
|
||||
expect(result.data.reddit.sellerDomains).toContain('telegram.me');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -249,6 +249,9 @@ describe('Prompt Testing', () => {
|
||||
expect(keywords).toContain('manyvids');
|
||||
expect(keywords).toContain('cash.app');
|
||||
expect(keywords).toContain('venmo');
|
||||
expect(keywords).toContain('telegram');
|
||||
expect(config.reddit.sellerDomains).toContain('t.me');
|
||||
expect(config.reddit.sellerDomains).toContain('telegram.me');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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' } } } })
|
||||
|
||||
Reference in new issue
Block a user