fix: fixed captcha issue with response (#787)

* fix: fixed captcha issue with response

* fix: fixed test case
This commit is contained in:
sundasnoreen12
2025-07-17 19:41:19 +05:00
committed by GitHub
parent 2241575cc0
commit 806c989eac
2 changed files with 2 additions and 2 deletions

View File

@@ -321,7 +321,7 @@ describe('ThreadView', () => {
await waitFor(() => {
expect(axiosMock.history.post).toHaveLength(1);
expect(JSON.parse(axiosMock.history.post[0].data)).toMatchObject({
captcha_token: 'm',
captcha_token: 'mock-token',
enable_in_context_sidebar: false,
parent_id: 'comment-1',
raw_body: 'New comment with CAPTCHA',

View File

@@ -117,7 +117,7 @@ const CommentEditor = ({
};
await dispatch(editComment(id, payload));
} else {
await dispatch(addComment(values.comment, threadId, parentId, enableInContextSidebar, ...(shouldRequireCaptcha ? values.recaptchaToken : '')));
await dispatch(addComment(values.comment, threadId, parentId, enableInContextSidebar, shouldRequireCaptcha ? values.recaptchaToken : ''));
}
/* istanbul ignore if: TinyMCE is mocked so this cannot be easily tested */
if (editorRef.current) {