Policy test follows the new link-farm report wording (new / still watched / left the list)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-31 07:29:06 -05:00
parent 58dcbf8cee
commit 12788e799f
+1 -1
View File
@@ -113,7 +113,7 @@ const spamscan = require(path.join(ROOT, 'spamscan.js'));
const b = bench();
let r = await spamscan.tick(at(6, 0)); eq(r.skipped, true, 'before 06:30'); eq(b.sent.length, 0);
r = await spamscan.tick(at(6, 31)); truthy(r.candidates, 'ran'); eq(r.candidates.length, 3, 'three candidates'); eq(r.skipped, 1, 'one allowlisted');
eq(b.sent.length, 1, 'one telegram'); truthy(b.sent[0].startsWith(SITE + ' link-farm scan: 3 candidate accounts ('), b.sent[0].split('\n')[0]);
eq(b.sent.length, 1, 'one telegram'); truthy(b.sent[0].startsWith(SITE + ' link-farm scan (') && /: 3 new, 0 still watched, 0 left the list$/.test(b.sent[0].split('\n')[0]), b.sent[0].split('\n')[0]);
truthy(b.sent[0].includes('Review in Admin > Members > Link-farm list'), 'review line'); truthy(b.sent[0].includes('@farm1 | joined ') && b.sent[0].includes('| https://casino-x.com/ | also on ' + (isLS ? 'InstantAdPay' : 'LinkSpin')), b.sent[0]);
r = await spamscan.tick(at(9, 0)); eq(r.skipped, true, 'second tick same day'); eq(b.sent.length, 1, 'still one telegram');
const file = JSON.parse(fs.readFileSync(path.join(b.dir, 'wall-spam-scan.json'), 'utf8'));