Add outreach rejection reasons tab

This commit is contained in:
jjbrunton committed 2026-08-14 15:18:46 +01:00
1 parent 7af7b211fa
commit 0c21202253
7 files changed
+114 -26

No files matched your search

+6
View File
@@ -129,6 +129,7 @@ describe('dashboard foundation', () => {
activeCount: 3,
stages: { discovered: 1, screening: 0, ready: 1, sending: 0, retryable: 1 },
outcomes: { sent: 12, rejected: 7 },
rejectionReasons: [{ reason: 'Seller signals detected', count: 5 }, { reason: 'No gender tag in title/body', count: 2 }],
oldestActiveAt: Date.parse('2026-08-09T07:00:00Z'),
candidates: [{
postId: 'candidate-1', subreddit: 'example', author: 'alice', title: '[25F] A potential post',
@@ -169,6 +170,10 @@ describe('dashboard foundation', () => {
expect(await screen.findByRole('heading', { name: 'Outreach funnel' })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: '3 active posts' })).toBeInTheDocument();
await user.click(screen.getByRole('tab', { name: 'Rejections 7' }));
expect(screen.getByRole('tabpanel', { name: 'Rejections 7' })).toHaveTextContent('Seller signals detected');
expect(screen.getByRole('list', { name: 'Outreach rejection reasons' })).toHaveTextContent('5');
await user.click(screen.getByRole('tab', { name: 'Active queue 3' }));
expect(screen.getByRole('list', { name: 'Active outreach candidates' })).toHaveTextContent('A potential post');
expect(screen.getAllByRole('link', { name: '[25F] A potential post' }))
.toEqual(expect.arrayContaining([
@@ -219,6 +224,7 @@ describe('dashboard foundation', () => {
activeCount: cleared ? 1 : 3,
stages: { discovered: cleared ? 0 : 2, screening: 0, ready: 0, sending: 1, retryable: 0 },
outcomes: { sent: 12, rejected: cleared ? 9 : 7 },
rejectionReasons: [{ reason: 'Cleared manually by operator', count: cleared ? 2 : 0 }].filter(({ count }) => count > 0),
oldestActiveAt: Date.now() - 60_000,
candidates: [],
})),