Files
RedditBot/tests/comment-targeted-opener.test.ts

40 lines
1.7 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { validateCommentTargetedOpener } from '../src/services/comment-targeted-opener.js';
describe('validateCommentTargetedOpener', () => {
it('accepts an opener grounded in the expressed experience', () => {
expect(validateCommentTargetedOpener(
'I saw your comment about wishing that was you being pinned down. What part of that idea gets to you most?',
)).toEqual({ safe: true });
});
it('accepts another explicit first-sentence reference to what was written', () => {
expect(validateCommentTargetedOpener(
'You said you would cuff her hands and bend her over your lap. That confidence caught my attention.',
)).toEqual({ safe: true });
});
it.each([
'Your tits look incredible in that shot, I saw your comment.',
'You look so good kneeling there, your comment caught my eye.',
'I saw your comment. Send me another photo like that.',
'Your post caught my eye and I liked what you said.',
'I saw your comment. What made you decide to look up at the camera like that?',
])('rejects source-image attribution: %s', (message) => {
expect(validateCommentTargetedOpener(message).safe).toBe(false);
});
it('rejects an image-only opener even when it avoids explicit anatomy', () => {
expect(validateCommentTargetedOpener('That scene is incredibly hot.')).toEqual({
safe: false,
reason: 'does not ground the opener in what the commenter expressed',
});
});
it('rejects a generic first sentence even when a later sentence mentions the comment', () => {
expect(validateCommentTargetedOpener(
'What draws you to that scenario? Your comment painted a vivid picture.',
).safe).toBe(false);
});
});