Files
RedditBot/tests/outbound-message-safety.test.ts

32 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { isSafeOutboundMessage } from '../src/services/outbound-message-safety.js';
describe('outbound message location safety', () => {
it.each([
"I'm in London too.",
"I'm also in Manchester, small world.",
"We're both in England, that's handy.",
"Sounds like we're in the same area.",
"I'm not far from you at all.",
"You're nearby, we should meet up.",
"That's near me, small world.",
"You're practically my neighbour.",
"You're just down the road.",
"I'm only 20 minutes away.",
'Always nice finding another Brit.',
'We could grab a drink sometime.',
'Come over tonight.',
])('rejects proximity or meeting implication: %s', (message) => {
expect(isSafeOutboundMessage(message)).toBe(false);
});
it.each([
"I'm 34M in the UK. What are you into?",
'That sounds fun, tell me more about it.',
'Would you be comfortable sharing a selfie?',
'Nice to meet you, what kind of music do you like?',
])('allows remote conversation without a location comparison: %s', (message) => {
expect(isSafeOutboundMessage(message)).toBe(true);
});
});