@@ -141,6 +141,9 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
141
141
} ) ;
142
142
143
143
it ( 'should handle recaptcha when emailPasswordEnabled is true' , async ( ) => {
144
+ if ( typeof window === 'undefined' ) {
145
+ return ;
146
+ }
144
147
sinon . stub ( mockAuthInstance , '_getRecaptchaConfig' ) . returns ( {
145
148
emailPasswordEnabled : true ,
146
149
siteKey : 'mock_site_key'
@@ -156,10 +159,12 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
156
159
157
160
expect ( result ) . to . equal ( 'success' ) ;
158
161
expect ( mockActionMethod ) . to . have . been . calledOnce ;
159
- // Add more assertions as needed, e.g., checking if injectRecaptchaFields was called
160
162
} ) ;
161
163
162
164
it ( 'should handle action without recaptcha when emailPasswordEnabled is false and no error' , async ( ) => {
165
+ if ( typeof window === 'undefined' ) {
166
+ return ;
167
+ }
163
168
sinon . stub ( mockAuthInstance , '_getRecaptchaConfig' ) . returns ( {
164
169
emailPasswordEnabled : false ,
165
170
siteKey : 'mock_site_key'
@@ -178,6 +183,9 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
178
183
} ) ;
179
184
180
185
it ( 'should handle MISSING_RECAPTCHA_TOKEN error when emailPasswordEnabled is false' , async ( ) => {
186
+ if ( typeof window === 'undefined' ) {
187
+ return ;
188
+ }
181
189
sinon . stub ( mockAuthInstance , '_getRecaptchaConfig' ) . returns ( {
182
190
emailPasswordEnabled : false ,
183
191
siteKey : 'mock_site_key'
@@ -196,7 +204,6 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
196
204
197
205
expect ( result ) . to . equal ( 'success-after-recaptcha' ) ;
198
206
expect ( mockActionMethod ) . to . have . been . calledTwice ;
199
- // Add more assertions as needed, e.g., checking if injectRecaptchaFields was called
200
207
} ) ;
201
208
} ) ;
202
209
} ) ;
0 commit comments