fix: fixed captcha issue with response (#787)
* fix: fixed captcha issue with response * fix: fixed test case
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user