Fix commenter-targeted outreach attribution

This commit is contained in:
jjbrunton committed 2026-08-14 12:45:16 +01:00
1 parent b5304e24e3
commit f77157d303
19 files changed
+328 -49

No files matched your search

+11 -2
View File
@@ -133,12 +133,16 @@ describe('dashboard foundation', () => {
candidates: [{
postId: 'candidate-1', subreddit: 'example', author: 'alice', title: '[25F] A potential post',
postUrl: 'https://www.reddit.com/r/example/comments/candidate-1/', sourceType: 'image',
targetComment: {
body: 'I wish that was me being pinned down',
permalink: 'https://www.reddit.com/r/example/comments/candidate-1/comment-1/',
},
status: 'ready', priority: 2, postCreatedAt: Date.parse('2026-08-09T06:50:00Z'),
discoveredAt: Date.parse('2026-08-09T07:00:00Z'), updatedAt: Date.parse('2026-08-09T07:30:00Z'),
availableAt: Date.parse('2026-08-09T07:30:00Z'), attemptCount: 1, hasPreparedMessage: true,
physiqueScore: 6,
preparation: {
message: 'You look incredible in that pose — what inspired this post?',
message: 'I saw your comment about wishing that was you being pinned down. What part gets to you most?',
imageAnalysis: 'VISIBLE_FACTS:\nBODY: VISIBLE - full-body pose',
detectedGender: 'female', attractivenessScore: 68, physiqueScore: 6,
physiqueTargeting: { enabled: true, minScore: 1, maxScore: 6 },
@@ -172,7 +176,12 @@ describe('dashboard foundation', () => {
]));
expect(within(screen.getByRole('list', { name: 'Active outreach candidates' })).getByText('Message prepared')).toBeInTheDocument();
const preparation = screen.getByRole('region', { name: 'Prepared outreach for u/alice' });
expect(preparation).toHaveTextContent('You look incredible in that pose');
expect(preparation).toHaveTextContent('I saw your comment about wishing that was you');
expect(preparation).toHaveTextContent('Comment that qualified this recipient');
expect(preparation).toHaveTextContent('I wish that was me being pinned down');
expect(within(preparation).getByRole('link', { name: 'View comment on Reddit ↗' }))
.toHaveAttribute('href', 'https://www.reddit.com/r/example/comments/candidate-1/comment-1/');
expect(screen.getByText('Commenter')).toBeInTheDocument();
expect(preparation).toHaveTextContent('68/100');
expect(preparation).toHaveTextContent('6/10');
expect(preparation).toHaveTextContent('Current target 1–6');