Skip to content

Commit 806c989

Browse files
fix: fixed captcha issue with response (#787)
* fix: fixed captcha issue with response * fix: fixed test case
1 parent 2241575 commit 806c989

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/discussions/post-comments/PostCommentsView.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ describe('ThreadView', () => {
321321
await waitFor(() => {
322322
expect(axiosMock.history.post).toHaveLength(1);
323323
expect(JSON.parse(axiosMock.history.post[0].data)).toMatchObject({
324-
captcha_token: 'm',
324+
captcha_token: 'mock-token',
325325
enable_in_context_sidebar: false,
326326
parent_id: 'comment-1',
327327
raw_body: 'New comment with CAPTCHA',

src/discussions/post-comments/comments/comment/CommentEditor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const CommentEditor = ({
117117
};
118118
await dispatch(editComment(id, payload));
119119
} else {
120-
await dispatch(addComment(values.comment, threadId, parentId, enableInContextSidebar, ...(shouldRequireCaptcha ? values.recaptchaToken : '')));
120+
await dispatch(addComment(values.comment, threadId, parentId, enableInContextSidebar, shouldRequireCaptcha ? values.recaptchaToken : ''));
121121
}
122122
/* istanbul ignore if: TinyMCE is mocked so this cannot be easily tested */
123123
if (editorRef.current) {

0 commit comments

Comments
 (0)