mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
use global.recaptcha instead of global.window.grecaptcha.
This commit is contained in:
parent
bd33b166f7
commit
c9d7293119
1 changed files with 3 additions and 3 deletions
|
@ -67,7 +67,7 @@ describe('EmailStep test', () => {
|
||||||
const formikBag = {
|
const formikBag = {
|
||||||
setSubmitting: jest.fn()
|
setSubmitting: jest.fn()
|
||||||
};
|
};
|
||||||
global.window.grecaptcha = {
|
global.grecaptcha = {
|
||||||
execute: jest.fn(),
|
execute: jest.fn(),
|
||||||
render: jest.fn()
|
render: jest.fn()
|
||||||
};
|
};
|
||||||
|
@ -80,7 +80,7 @@ describe('EmailStep test', () => {
|
||||||
formikWrapper.instance().handleValidSubmit(formData, formikBag);
|
formikWrapper.instance().handleValidSubmit(formData, formikBag);
|
||||||
|
|
||||||
expect(formikBag.setSubmitting).toHaveBeenCalledWith(false);
|
expect(formikBag.setSubmitting).toHaveBeenCalledWith(false);
|
||||||
expect(global.window.grecaptcha.execute).toHaveBeenCalled();
|
expect(global.grecaptcha.execute).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
test('captchaSolved sets token and goes to next step', () => {
|
test('captchaSolved sets token and goes to next step', () => {
|
||||||
const props = {
|
const props = {
|
||||||
|
@ -89,7 +89,7 @@ describe('EmailStep test', () => {
|
||||||
const formikBag = {
|
const formikBag = {
|
||||||
setSubmitting: jest.fn()
|
setSubmitting: jest.fn()
|
||||||
};
|
};
|
||||||
global.window.grecaptcha = {
|
global.grecaptcha = {
|
||||||
execute: jest.fn(),
|
execute: jest.fn(),
|
||||||
render: jest.fn()
|
render: jest.fn()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue