Add recent outreach rejections stream
This commit is contained in:
1 parent
0c21202253
commit
94049ed9c4
9 files changed
+170
-16
No files matched your search
@@ -130,6 +130,11 @@ describe('dashboard foundation', () => {
|
||||
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 }],
|
||||
recentRejections: [{
|
||||
postId: 'rejected-1', subreddit: 'example', author: 'bob', title: '[24F] Rejected post',
|
||||
postUrl: 'https://www.reddit.com/r/example/comments/rejected-1/', sourceType: 'chat',
|
||||
sourceContent: 'This is the content that was screened.', rejectedAt: Date.parse('2026-08-09T07:45:00Z'), reason: 'Seller signals detected',
|
||||
}],
|
||||
oldestActiveAt: Date.parse('2026-08-09T07:00:00Z'),
|
||||
candidates: [{
|
||||
postId: 'candidate-1', subreddit: 'example', author: 'alice', title: '[25F] A potential post',
|
||||
@@ -170,9 +175,12 @@ 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');
|
||||
await user.click(screen.getByRole('tab', { name: 'Rejection reasons 7' }));
|
||||
expect(screen.getByRole('tabpanel', { name: 'Rejection reasons 7' })).toHaveTextContent('Seller signals detected');
|
||||
expect(screen.getByRole('list', { name: 'Outreach rejection reasons' })).toHaveTextContent('5');
|
||||
await user.click(screen.getByRole('tab', { name: 'Recent rejections 1' }));
|
||||
expect(screen.getByRole('list', { name: 'Recent rejected outreach candidates' })).toHaveTextContent('This is the content that was screened.');
|
||||
expect(screen.getByText('Rejected because')).toBeInTheDocument();
|
||||
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' }))
|
||||
@@ -225,6 +233,7 @@ describe('dashboard foundation', () => {
|
||||
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),
|
||||
recentRejections: [],
|
||||
oldestActiveAt: Date.now() - 60_000,
|
||||
candidates: [],
|
||||
})),
|
||||
|
||||
Reference in new issue
Block a user