feat(dashboard): close legacy parity gaps
This commit is contained in:
1 parent
92287c0a9a
commit
4b3f00729f
21 files changed
+397
-28
No files matched your search
@@ -178,6 +178,27 @@ describe('ConversationsPage', () => {
|
||||
expect(sendRequests).toBe(2);
|
||||
});
|
||||
|
||||
it('generates a media ask and looks up durable processed-user history', async () => {
|
||||
installConversationList();
|
||||
server.use(
|
||||
http.post('/api/conversations/room-alice/suggest-media-ask', () => HttpResponse.json({ suggestedReply: 'Would you like to share a photo?' })),
|
||||
http.get('/api/posts/by-author/alice', () => HttpResponse.json([{
|
||||
id: 'post-1', subreddit: 'askuk', author: 'alice', title: 'A processed post',
|
||||
imageUrl: null, imageAnalysis: null, generatedMessage: 'Hello',
|
||||
processedAt: Date.now(), messageSent: true, error: null,
|
||||
}])),
|
||||
);
|
||||
const user = userEvent.setup();
|
||||
renderConversations();
|
||||
await user.type(screen.getByLabelText('Lookup Reddit username'), 'u/alice');
|
||||
await user.click(screen.getByRole('button', { name: 'Look up user' }));
|
||||
expect(await screen.findByRole('list', { name: 'Processed posts for u/alice' })).toHaveTextContent('A processed post');
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /u\/alice/ }));
|
||||
await user.click(await screen.findByRole('button', { name: 'Suggest media ask' }));
|
||||
expect(await screen.findByRole('textbox', { name: 'Reply to u/alice' })).toHaveValue('Would you like to share a photo?');
|
||||
});
|
||||
|
||||
it('starts a conversation and preserves both fields after a recoverable failure', async () => {
|
||||
installConversationList();
|
||||
let startRequests = 0;
|
||||
|
||||
Reference in new issue
Block a user