use global.recaptcha instead of global.window.grecaptcha.

This commit is contained in:
picklesrus 2019-08-30 13:42:49 -04:00
parent bd33b166f7
commit c9d7293119

View file

@ -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()
}; };