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 = {
setSubmitting: jest.fn()
};
global.window.grecaptcha = {
global.grecaptcha = {
execute: jest.fn(),
render: jest.fn()
};
@ -80,7 +80,7 @@ describe('EmailStep test', () => {
formikWrapper.instance().handleValidSubmit(formData, formikBag);
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', () => {
const props = {
@ -89,7 +89,7 @@ describe('EmailStep test', () => {
const formikBag = {
setSubmitting: jest.fn()
};
global.window.grecaptcha = {
global.grecaptcha = {
execute: jest.fn(),
render: jest.fn()
};