Files
RedditBot/tests/conversation-outcome.test.ts
T

21 lines
752 B
TypeScript

import { describe, expect, it } from 'vitest';
import { classifyConversationOutcome } from '../src/services/conversation-outcome.js';
describe('conversation outcome classification', () => {
it.each([
['That sounds fun, tell me more', 'unknown'],
['No thanks, not interested', 'declined'],
['Check my OnlyFans link in bio', 'upsell'],
['Stop messaging me', 'boundary'],
] as const)('classifies %s as %s', (reply, expected) => {
expect(classifyConversationOutcome(reply)).toBe(expected);
});
it('classifies a reciprocal multi-message conversation as engaged', () => {
expect(classifyConversationOutcome('That sounds fun, tell me more', {
messageCount: 4,
reciprocal: true,
})).toBe('engaged');
});
});