auth0-lock 11.35.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +3 -1
- package/.shiprc +4 -5
- package/CHANGELOG.md +25 -0
- package/DEVELOPMENT.md +1 -1
- package/README.md +20 -16
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +24 -47
- package/lib/__tests__/connection/database/password_reset_confirmation.js +23 -32
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +23 -32
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +32 -75
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +23 -32
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +23 -32
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless/social_or_email_login_screen.js +7 -28
- package/lib/__tests__/engine/passwordless/social_or_phone_number_login_screen.js +7 -28
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +23 -42
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +15 -34
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -65
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +154 -305
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +30 -51
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +22 -28
- package/lib/core/web_api/p2_api.js +162 -171
- package/lib/core/web_api.js +106 -94
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +80 -116
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +79 -110
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +83 -103
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +50 -87
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/package.json +48 -34
- package/webpack.config.js +36 -3
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _react = require('react');
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(_react);
|
|
6
|
-
|
|
7
|
-
var _enzyme = require('enzyme');
|
|
8
|
-
|
|
9
|
-
var _testUtils = require('testUtils');
|
|
1
|
+
"use strict";
|
|
10
2
|
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
var _enzyme = require("enzyme");
|
|
5
|
+
var _testUtils = require("testUtils");
|
|
11
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
7
|
jest.mock('engine/classic/sign_up_pane', function () {
|
|
14
8
|
return (0, _testUtils.mockComponent)('sign_up_pane');
|
|
15
9
|
});
|
|
@@ -28,20 +22,16 @@ jest.mock('connection/database/login_sign_up_tabs', function () {
|
|
|
28
22
|
jest.mock('connection/enterprise/single_sign_on_notice', function () {
|
|
29
23
|
return (0, _testUtils.mockComponent)('single_sign_on_notice');
|
|
30
24
|
});
|
|
31
|
-
|
|
32
25
|
var getScreen = function getScreen() {
|
|
33
26
|
var SignUpScreen = require('engine/classic/sign_up_screen').default;
|
|
34
27
|
return new SignUpScreen();
|
|
35
28
|
};
|
|
36
|
-
|
|
37
29
|
var getComponent = function getComponent() {
|
|
38
30
|
return getScreen().render();
|
|
39
31
|
};
|
|
40
|
-
|
|
41
32
|
describe('SignUpScreen', function () {
|
|
42
33
|
beforeEach(function () {
|
|
43
34
|
jest.resetModules();
|
|
44
|
-
|
|
45
35
|
jest.mock('connection/database/index', function () {
|
|
46
36
|
return {
|
|
47
37
|
databaseUsernameValue: function databaseUsernameValue(model, options) {
|
|
@@ -62,7 +52,6 @@ describe('SignUpScreen', function () {
|
|
|
62
52
|
}
|
|
63
53
|
};
|
|
64
54
|
});
|
|
65
|
-
|
|
66
55
|
jest.mock('connection/database/actions', function () {
|
|
67
56
|
return {
|
|
68
57
|
signUp: jest.fn(),
|
|
@@ -90,7 +79,6 @@ describe('SignUpScreen', function () {
|
|
|
90
79
|
renderSignedUpConfirmation: jest.fn()
|
|
91
80
|
};
|
|
92
81
|
});
|
|
93
|
-
|
|
94
82
|
jest.mock('field/index', function () {
|
|
95
83
|
return {
|
|
96
84
|
renderOptionSelection: function renderOptionSelection() {
|
|
@@ -98,7 +86,6 @@ describe('SignUpScreen', function () {
|
|
|
98
86
|
}
|
|
99
87
|
};
|
|
100
88
|
});
|
|
101
|
-
|
|
102
89
|
jest.mock('connection/enterprise', function () {
|
|
103
90
|
return {
|
|
104
91
|
isHRDDomain: function isHRDDomain() {
|
|
@@ -106,19 +93,18 @@ describe('SignUpScreen', function () {
|
|
|
106
93
|
}
|
|
107
94
|
};
|
|
108
95
|
});
|
|
109
|
-
|
|
110
96
|
jest.mock('connection/enterprise/actions', function () {
|
|
111
97
|
return {
|
|
112
98
|
logIn: jest.fn()
|
|
113
99
|
};
|
|
114
100
|
});
|
|
115
|
-
|
|
116
101
|
jest.mock('i18n', function () {
|
|
117
|
-
return {
|
|
102
|
+
return {
|
|
103
|
+
str: function str(_, keys) {
|
|
118
104
|
return keys.join(',');
|
|
119
|
-
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
120
107
|
});
|
|
121
|
-
|
|
122
108
|
jest.mock('core/index', function () {
|
|
123
109
|
return {
|
|
124
110
|
hasSomeConnections: function hasSomeConnections() {
|
|
@@ -133,24 +119,21 @@ describe('SignUpScreen', function () {
|
|
|
133
119
|
var defaultProps = {
|
|
134
120
|
i18n: {
|
|
135
121
|
str: function str() {
|
|
136
|
-
for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {
|
|
122
|
+
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
137
123
|
keys[_key] = arguments[_key];
|
|
138
124
|
}
|
|
139
|
-
|
|
140
125
|
return keys.join(',');
|
|
141
126
|
},
|
|
142
127
|
group: function group() {
|
|
143
|
-
for (var _len2 = arguments.length, keys = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
128
|
+
for (var _len2 = arguments.length, keys = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
144
129
|
keys[_key2] = arguments[_key2];
|
|
145
130
|
}
|
|
146
|
-
|
|
147
131
|
return keys.join(',');
|
|
148
132
|
},
|
|
149
133
|
html: function html() {
|
|
150
|
-
for (var _len3 = arguments.length, keys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
134
|
+
for (var _len3 = arguments.length, keys = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
151
135
|
keys[_key3] = arguments[_key3];
|
|
152
136
|
}
|
|
153
|
-
|
|
154
137
|
return keys.join(',');
|
|
155
138
|
}
|
|
156
139
|
},
|
|
@@ -158,16 +141,14 @@ describe('SignUpScreen', function () {
|
|
|
158
141
|
};
|
|
159
142
|
it('renders empty div by default', function () {
|
|
160
143
|
var Component = getComponent();
|
|
161
|
-
|
|
162
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
144
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
163
145
|
});
|
|
164
146
|
it('renders SocialButtonsPane when has social connections', function () {
|
|
165
147
|
require('core/index').hasSomeConnections = function (m, connection) {
|
|
166
148
|
return connection === 'social';
|
|
167
149
|
};
|
|
168
150
|
var Component = getComponent();
|
|
169
|
-
|
|
170
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
151
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
171
152
|
});
|
|
172
153
|
it('disables SocialButtonsPane when terms were not accepted', function () {
|
|
173
154
|
require('core/index').hasSomeConnections = function (m, connection) {
|
|
@@ -177,8 +158,7 @@ describe('SignUpScreen', function () {
|
|
|
177
158
|
return false;
|
|
178
159
|
};
|
|
179
160
|
var Component = getComponent();
|
|
180
|
-
|
|
181
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
161
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
182
162
|
});
|
|
183
163
|
it('renders SingleSignOnNotice when SSO is enabled and has screen login', function () {
|
|
184
164
|
require('engine/classic').isSSOEnabled = function () {
|
|
@@ -187,18 +167,15 @@ describe('SignUpScreen', function () {
|
|
|
187
167
|
require('connection/database/index').hasScreen = function (m, screenName) {
|
|
188
168
|
return screenName === 'login';
|
|
189
169
|
};
|
|
190
|
-
|
|
191
170
|
var Component = getComponent();
|
|
192
|
-
|
|
193
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
171
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
194
172
|
});
|
|
195
173
|
it('renders LoginSignUpTabs SSO is disabled and has screen login', function () {
|
|
196
174
|
require('connection/database/index').hasScreen = function (m, screenName) {
|
|
197
175
|
return screenName === 'login';
|
|
198
176
|
};
|
|
199
177
|
var Component = getComponent();
|
|
200
|
-
|
|
201
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
178
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
202
179
|
});
|
|
203
180
|
describe('renders SignUpPane', function () {
|
|
204
181
|
it('when has database connection', function () {
|
|
@@ -206,25 +183,21 @@ describe('SignUpScreen', function () {
|
|
|
206
183
|
return connection === 'database';
|
|
207
184
|
};
|
|
208
185
|
var Component = getComponent();
|
|
209
|
-
|
|
210
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
186
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
211
187
|
});
|
|
212
188
|
it('when has enterprise connection', function () {
|
|
213
189
|
require('core/index').hasSomeConnections = function (m, connection) {
|
|
214
190
|
return connection === 'enterprise';
|
|
215
191
|
};
|
|
216
192
|
var Component = getComponent();
|
|
217
|
-
|
|
218
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
193
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
219
194
|
});
|
|
220
195
|
});
|
|
221
196
|
describe('on Submit, uses `options.emailFirst=true` and', function () {
|
|
222
197
|
it('calls signup', function () {
|
|
223
198
|
var screen = getScreen();
|
|
224
199
|
screen.submitHandler()();
|
|
225
|
-
|
|
226
200
|
var mock = require('connection/database/actions').signUp.mock;
|
|
227
|
-
|
|
228
201
|
expect(mock.calls.length).toBe(1);
|
|
229
202
|
});
|
|
230
203
|
});
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
9
|
var getClassic = function getClassic() {
|
|
6
10
|
return require('engine/classic').default;
|
|
7
11
|
};
|
|
8
|
-
|
|
9
12
|
describe('Classic Engine', function () {
|
|
10
13
|
beforeEach(function () {
|
|
11
14
|
jest.mock('connection/database/index', function () {
|
|
12
15
|
return {
|
|
13
16
|
resolveAdditionalSignUpFields: function resolveAdditionalSignUpFields(m) {
|
|
14
|
-
return
|
|
17
|
+
return _objectSpread(_objectSpread({}, m), {}, {
|
|
18
|
+
resolveAdditionalSignUpFields: true
|
|
19
|
+
});
|
|
15
20
|
},
|
|
16
21
|
overrideDatabaseOptions: function overrideDatabaseOptions(m) {
|
|
17
|
-
return
|
|
22
|
+
return _objectSpread(_objectSpread({}, m), {}, {
|
|
23
|
+
overrideDatabaseOptions: true
|
|
24
|
+
});
|
|
18
25
|
}
|
|
19
26
|
};
|
|
20
27
|
});
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _react = require('react');
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(_react);
|
|
6
|
-
|
|
7
|
-
var _testUtils = require('testUtils');
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
var _testUtils = require("testUtils");
|
|
9
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
6
|
jest.mock('connection/enterprise');
|
|
12
7
|
jest.mock('core/index');
|
|
13
|
-
|
|
14
8
|
jest.mock('field/social/social_buttons_pane', function () {
|
|
15
9
|
return (0, _testUtils.mockComponent)('social_buttons_pane');
|
|
16
10
|
});
|
|
@@ -31,18 +25,15 @@ jest.mock('connection/passwordless/index', function () {
|
|
|
31
25
|
isEmail: jest.fn()
|
|
32
26
|
};
|
|
33
27
|
});
|
|
34
|
-
|
|
35
28
|
var getComponent = function getComponent() {
|
|
36
29
|
var SocialOrEmailScreen = require('engine/passwordless/social_or_email_login_screen').default;
|
|
37
30
|
var screen = new SocialOrEmailScreen();
|
|
38
31
|
return screen.render();
|
|
39
32
|
};
|
|
40
|
-
|
|
41
33
|
describe('email passwordless', function () {
|
|
42
34
|
beforeEach(function () {
|
|
43
35
|
jest.resetModules();
|
|
44
36
|
jest.resetAllMocks();
|
|
45
|
-
|
|
46
37
|
jest.mock('connection/database/index', function () {
|
|
47
38
|
return {
|
|
48
39
|
hasScreen: function hasScreen() {
|
|
@@ -51,20 +42,17 @@ describe('email passwordless', function () {
|
|
|
51
42
|
databaseUsernameValue: jest.fn()
|
|
52
43
|
};
|
|
53
44
|
});
|
|
54
|
-
|
|
55
45
|
jest.mock('connection/database/actions', function () {
|
|
56
46
|
return {
|
|
57
47
|
cancelMFALogin: jest.fn(),
|
|
58
48
|
logIn: jest.fn()
|
|
59
49
|
};
|
|
60
50
|
});
|
|
61
|
-
|
|
62
51
|
jest.mock('core/signed_in_confirmation', function () {
|
|
63
52
|
return {
|
|
64
53
|
renderSignedInConfirmation: jest.fn()
|
|
65
54
|
};
|
|
66
55
|
});
|
|
67
|
-
|
|
68
56
|
jest.mock('connection/enterprise', function () {
|
|
69
57
|
return {
|
|
70
58
|
isHRDEmailValid: jest.fn(function () {
|
|
@@ -75,7 +63,6 @@ describe('email passwordless', function () {
|
|
|
75
63
|
})
|
|
76
64
|
};
|
|
77
65
|
});
|
|
78
|
-
|
|
79
66
|
jest.mock('core/index', function () {
|
|
80
67
|
return {
|
|
81
68
|
hasSomeConnections: jest.fn(function () {
|
|
@@ -85,42 +72,34 @@ describe('email passwordless', function () {
|
|
|
85
72
|
};
|
|
86
73
|
});
|
|
87
74
|
});
|
|
88
|
-
|
|
89
75
|
var defaultProps = {
|
|
90
76
|
i18n: {
|
|
91
77
|
str: function str() {
|
|
92
|
-
for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {
|
|
78
|
+
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
93
79
|
keys[_key] = arguments[_key];
|
|
94
80
|
}
|
|
95
|
-
|
|
96
81
|
return keys.join(',');
|
|
97
82
|
},
|
|
98
83
|
html: function html() {
|
|
99
|
-
for (var _len2 = arguments.length, keys = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
84
|
+
for (var _len2 = arguments.length, keys = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
100
85
|
keys[_key2] = arguments[_key2];
|
|
101
86
|
}
|
|
102
|
-
|
|
103
87
|
return keys.join(',');
|
|
104
88
|
}
|
|
105
89
|
},
|
|
106
90
|
model: 'model'
|
|
107
91
|
};
|
|
108
|
-
|
|
109
92
|
it('renders correctly', function () {
|
|
110
93
|
var Component = getComponent();
|
|
111
|
-
|
|
112
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
94
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
113
95
|
});
|
|
114
|
-
|
|
115
96
|
it('renders a captcha', function () {
|
|
116
97
|
var Component = getComponent();
|
|
117
|
-
|
|
118
98
|
require('core/index').passwordlessCaptcha.mockReturnValue({
|
|
119
99
|
get: function get() {
|
|
120
100
|
return true;
|
|
121
101
|
}
|
|
122
102
|
});
|
|
123
|
-
|
|
124
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
103
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
125
104
|
});
|
|
126
105
|
});
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _react = require('react');
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(_react);
|
|
6
|
-
|
|
7
|
-
var _testUtils = require('testUtils');
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
var _testUtils = require("testUtils");
|
|
9
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
6
|
jest.mock('connection/enterprise');
|
|
12
7
|
jest.mock('core/index');
|
|
13
|
-
|
|
14
8
|
jest.mock('field/social/social_buttons_pane', function () {
|
|
15
9
|
return (0, _testUtils.mockComponent)('social_buttons_pane');
|
|
16
10
|
});
|
|
@@ -31,18 +25,15 @@ jest.mock('connection/passwordless/index', function () {
|
|
|
31
25
|
isEmail: jest.fn()
|
|
32
26
|
};
|
|
33
27
|
});
|
|
34
|
-
|
|
35
28
|
var getComponent = function getComponent() {
|
|
36
29
|
var SocialOrPhoneNumberScreen = require('engine/passwordless/social_or_phone_number_login_screen').default;
|
|
37
30
|
var screen = new SocialOrPhoneNumberScreen();
|
|
38
31
|
return screen.render();
|
|
39
32
|
};
|
|
40
|
-
|
|
41
33
|
describe('sms passwordless', function () {
|
|
42
34
|
beforeEach(function () {
|
|
43
35
|
jest.resetModules();
|
|
44
36
|
jest.resetAllMocks();
|
|
45
|
-
|
|
46
37
|
jest.mock('connection/database/index', function () {
|
|
47
38
|
return {
|
|
48
39
|
hasScreen: function hasScreen() {
|
|
@@ -51,20 +42,17 @@ describe('sms passwordless', function () {
|
|
|
51
42
|
databaseUsernameValue: jest.fn()
|
|
52
43
|
};
|
|
53
44
|
});
|
|
54
|
-
|
|
55
45
|
jest.mock('connection/database/actions', function () {
|
|
56
46
|
return {
|
|
57
47
|
cancelMFALogin: jest.fn(),
|
|
58
48
|
logIn: jest.fn()
|
|
59
49
|
};
|
|
60
50
|
});
|
|
61
|
-
|
|
62
51
|
jest.mock('core/signed_in_confirmation', function () {
|
|
63
52
|
return {
|
|
64
53
|
renderSignedInConfirmation: jest.fn()
|
|
65
54
|
};
|
|
66
55
|
});
|
|
67
|
-
|
|
68
56
|
jest.mock('connection/enterprise', function () {
|
|
69
57
|
return {
|
|
70
58
|
isHRDEmailValid: jest.fn(function () {
|
|
@@ -75,7 +63,6 @@ describe('sms passwordless', function () {
|
|
|
75
63
|
})
|
|
76
64
|
};
|
|
77
65
|
});
|
|
78
|
-
|
|
79
66
|
jest.mock('core/index', function () {
|
|
80
67
|
return {
|
|
81
68
|
hasSomeConnections: jest.fn(function () {
|
|
@@ -85,42 +72,34 @@ describe('sms passwordless', function () {
|
|
|
85
72
|
};
|
|
86
73
|
});
|
|
87
74
|
});
|
|
88
|
-
|
|
89
75
|
var defaultProps = {
|
|
90
76
|
i18n: {
|
|
91
77
|
str: function str() {
|
|
92
|
-
for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {
|
|
78
|
+
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
93
79
|
keys[_key] = arguments[_key];
|
|
94
80
|
}
|
|
95
|
-
|
|
96
81
|
return keys.join(',');
|
|
97
82
|
},
|
|
98
83
|
html: function html() {
|
|
99
|
-
for (var _len2 = arguments.length, keys = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
84
|
+
for (var _len2 = arguments.length, keys = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
100
85
|
keys[_key2] = arguments[_key2];
|
|
101
86
|
}
|
|
102
|
-
|
|
103
87
|
return keys.join(',');
|
|
104
88
|
}
|
|
105
89
|
},
|
|
106
90
|
model: 'model'
|
|
107
91
|
};
|
|
108
|
-
|
|
109
92
|
it('renders correctly', function () {
|
|
110
93
|
var Component = getComponent();
|
|
111
|
-
|
|
112
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
94
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
113
95
|
});
|
|
114
|
-
|
|
115
96
|
it('renders a captcha', function () {
|
|
116
97
|
var Component = getComponent();
|
|
117
|
-
|
|
118
98
|
require('core/index').passwordlessCaptcha.mockReturnValue({
|
|
119
99
|
get: function get() {
|
|
120
100
|
return true;
|
|
121
101
|
}
|
|
122
102
|
});
|
|
123
|
-
|
|
124
|
-
(0, _testUtils.expectComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
103
|
+
(0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
|
|
125
104
|
});
|
|
126
105
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _testUtils = require('testUtils');
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
var _testUtils = require("testUtils");
|
|
5
4
|
var getEngine = function getEngine() {
|
|
6
5
|
return require('engine/passwordless').default;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
jest.mock('core/error_screen', function () {
|
|
10
8
|
return (0, _testUtils.mockComponent)('error_screen');
|
|
11
9
|
});
|
|
@@ -24,7 +22,6 @@ jest.mock('connection/passwordless/ask_vcode', function () {
|
|
|
24
22
|
jest.mock('core/sso/last_login_screen', function () {
|
|
25
23
|
return (0, _testUtils.mockComponent)('last_login_screen');
|
|
26
24
|
});
|
|
27
|
-
|
|
28
25
|
describe('Passwordless Engine', function () {
|
|
29
26
|
describe('didReceiveClientSettings calls setPrefill', function () {
|
|
30
27
|
beforeEach(function () {
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _react = require('react');
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(_react);
|
|
6
|
-
|
|
7
|
-
var _enzyme = require('enzyme');
|
|
8
|
-
|
|
9
|
-
var _immutable = require('immutable');
|
|
10
|
-
|
|
11
|
-
var _immutable2 = _interopRequireDefault(_immutable);
|
|
12
|
-
|
|
13
|
-
var _recaptcha = require('../../../field/captcha/recaptcha');
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
var _enzyme = require("enzyme");
|
|
5
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
6
|
+
var _recaptcha = require("../../../field/captcha/recaptcha");
|
|
15
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
8
|
var createLockMock = function createLockMock() {
|
|
18
9
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _immutable2.default.fromJS({
|
|
10
|
+
_ref$provider = _ref.provider,
|
|
11
|
+
provider = _ref$provider === void 0 ? 'none' : _ref$provider,
|
|
12
|
+
_ref$sitekey = _ref.sitekey,
|
|
13
|
+
sitekey = _ref$sitekey === void 0 ? '' : _ref$sitekey;
|
|
14
|
+
return _immutable.default.fromJS({
|
|
25
15
|
id: '__lock-id__',
|
|
26
16
|
core: {
|
|
27
|
-
captcha: {
|
|
17
|
+
captcha: {
|
|
18
|
+
provider: provider,
|
|
19
|
+
sitekey: sitekey
|
|
20
|
+
},
|
|
28
21
|
transient: {
|
|
29
22
|
ui: {
|
|
30
23
|
language: 'en-US'
|
|
@@ -33,15 +26,19 @@ var createLockMock = function createLockMock() {
|
|
|
33
26
|
}
|
|
34
27
|
});
|
|
35
28
|
};
|
|
36
|
-
|
|
37
29
|
describe('Recaptcha Enterprise', function () {
|
|
38
30
|
it('should match the snapshot', function () {
|
|
39
|
-
var mockLock = createLockMock({
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
var mockLock = createLockMock({
|
|
32
|
+
provider: 'recaptcha_enterprise',
|
|
33
|
+
sitekey: 'mySiteKey'
|
|
34
|
+
});
|
|
35
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_recaptcha.ReCAPTCHA, {
|
|
36
|
+
provider: 'recaptcha_enterprise',
|
|
37
|
+
lock: mockLock,
|
|
38
|
+
sitekey: 'mySiteKey'
|
|
39
|
+
}));
|
|
42
40
|
expect(wrapper).toMatchSnapshot();
|
|
43
41
|
});
|
|
44
|
-
|
|
45
42
|
describe('render', function () {
|
|
46
43
|
beforeAll(function () {
|
|
47
44
|
document.body.innerHTML = "<div id='renderTest'></div>";
|
|
@@ -50,7 +47,10 @@ describe('Recaptcha Enterprise', function () {
|
|
|
50
47
|
document.getElementById('renderTest').remove();
|
|
51
48
|
});
|
|
52
49
|
it('injects the script', function () {
|
|
53
|
-
_recaptcha.ReCAPTCHA.loadScript({
|
|
50
|
+
_recaptcha.ReCAPTCHA.loadScript({
|
|
51
|
+
hl: 'en-US',
|
|
52
|
+
provider: 'recaptcha_enterprise'
|
|
53
|
+
}, document.body);
|
|
54
54
|
expect(document.body.innerHTML).toContain('<div id="renderTest">');
|
|
55
55
|
expect(document.body.innerHTML).toContain('<script src="https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit');
|
|
56
56
|
});
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _react = require('react');
|
|
4
|
-
|
|
5
|
-
var _react2 = _interopRequireDefault(_react);
|
|
6
|
-
|
|
7
|
-
var _enzyme = require('enzyme');
|
|
8
|
-
|
|
9
|
-
var _immutable = require('immutable');
|
|
10
|
-
|
|
11
|
-
var _immutable2 = _interopRequireDefault(_immutable);
|
|
12
|
-
|
|
13
|
-
var _recaptcha = require('../../../field/captcha/recaptcha');
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
var _enzyme = require("enzyme");
|
|
5
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
6
|
+
var _recaptcha = require("../../../field/captcha/recaptcha");
|
|
15
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
8
|
var createLockMock = function createLockMock() {
|
|
18
9
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _immutable2.default.fromJS({
|
|
10
|
+
_ref$provider = _ref.provider,
|
|
11
|
+
provider = _ref$provider === void 0 ? 'none' : _ref$provider,
|
|
12
|
+
_ref$sitekey = _ref.sitekey,
|
|
13
|
+
sitekey = _ref$sitekey === void 0 ? '' : _ref$sitekey;
|
|
14
|
+
return _immutable.default.fromJS({
|
|
25
15
|
id: '__lock-id__',
|
|
26
16
|
core: {
|
|
27
|
-
captcha: {
|
|
17
|
+
captcha: {
|
|
18
|
+
provider: provider,
|
|
19
|
+
sitekey: sitekey
|
|
20
|
+
},
|
|
28
21
|
transient: {
|
|
29
22
|
ui: {
|
|
30
23
|
language: 'en-US'
|
|
@@ -33,15 +26,19 @@ var createLockMock = function createLockMock() {
|
|
|
33
26
|
}
|
|
34
27
|
});
|
|
35
28
|
};
|
|
36
|
-
|
|
37
29
|
describe('Recaptcha v2', function () {
|
|
38
30
|
it('should match the snapshot', function () {
|
|
39
|
-
var mockLock = createLockMock({
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
var mockLock = createLockMock({
|
|
32
|
+
provider: 'recaptcha_v2',
|
|
33
|
+
sitekey: 'mySiteKey'
|
|
34
|
+
});
|
|
35
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_recaptcha.ReCAPTCHA, {
|
|
36
|
+
provider: 'recaptcha_v2',
|
|
37
|
+
lock: mockLock,
|
|
38
|
+
sitekey: 'mySiteKey'
|
|
39
|
+
}));
|
|
42
40
|
expect(wrapper).toMatchSnapshot();
|
|
43
41
|
});
|
|
44
|
-
|
|
45
42
|
describe('render', function () {
|
|
46
43
|
beforeAll(function () {
|
|
47
44
|
document.body.innerHTML = "<div id='renderTest'></div>";
|
|
@@ -50,7 +47,10 @@ describe('Recaptcha v2', function () {
|
|
|
50
47
|
document.getElementById('renderTest').remove();
|
|
51
48
|
});
|
|
52
49
|
it('injects the script', function () {
|
|
53
|
-
_recaptcha.ReCAPTCHA.loadScript({
|
|
50
|
+
_recaptcha.ReCAPTCHA.loadScript({
|
|
51
|
+
hl: 'en-US',
|
|
52
|
+
provider: 'recaptcha_v2'
|
|
53
|
+
}, document.body);
|
|
54
54
|
expect(document.body.innerHTML).toContain('<div id="renderTest">');
|
|
55
55
|
expect(document.body.innerHTML).toContain('<script src="https://www.recaptcha.net/recaptcha/api.js?hl=en-US');
|
|
56
56
|
});
|