The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(feedback): cover comment post errors\n
Sami Rusani230010f9f8dd
diff --git a/app/src/components/feedback/FeedbackComments.test.tsx b/app/src/components/feedback/FeedbackComments.test.tsxindex 4e44a74f72..972b0d95d8 100644--- a/app/src/components/feedback/FeedbackComments.test.tsx+++ b/app/src/components/feedback/FeedbackComments.test.tsx@@ -66,6 +66,23 @@ describe('<FeedbackComments />', () => {expect(onCommentAdded).toHaveBeenCalledTimes(1);});+ it('surfaces an API error when posting a comment fails', async () => {+ mockGetFeedback.mockResolvedValueOnce({ feedback: { id: 'f1' }, comments: [] });+ mockAddComment.mockRejectedValueOnce({ success: false, error: 'Comment could not be posted.' });+ const onCommentAdded = vi.fn();++ renderWithProviders(<FeedbackComments feedbackId="f1" onCommentAdded={onCommentAdded} />);+ await screen.findByText('No comments yet.');++ fireEvent.change(screen.getByPlaceholderText('Add a comment'), {+ target: { value: 'a new comment' },+ });+ fireEvent.click(screen.getByText('Post'));++ expect(await screen.findByText('Comment could not be posted.')).toBeInTheDocument();+ expect(onCommentAdded).not.toHaveBeenCalled();+ });+it('surfaces a load error', async () => {mockGetFeedback.mockRejectedValueOnce(new Error('nope'));