Skip to content

Commit 4774ddb

Browse files
author
renkelvin
committed
Update recaptcha_enterprise_verifier.test.ts
1 parent e834c72 commit 4774ddb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
141141
});
142142

143143
it('should handle recaptcha when emailPasswordEnabled is true', async () => {
144+
if (typeof window === 'undefined') {
145+
return;
146+
}
144147
sinon.stub(mockAuthInstance, '_getRecaptchaConfig').returns({
145148
emailPasswordEnabled: true,
146149
siteKey: 'mock_site_key'
@@ -156,10 +159,12 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
156159

157160
expect(result).to.equal('success');
158161
expect(mockActionMethod).to.have.been.calledOnce;
159-
// Add more assertions as needed, e.g., checking if injectRecaptchaFields was called
160162
});
161163

162164
it('should handle action without recaptcha when emailPasswordEnabled is false and no error', async () => {
165+
if (typeof window === 'undefined') {
166+
return;
167+
}
163168
sinon.stub(mockAuthInstance, '_getRecaptchaConfig').returns({
164169
emailPasswordEnabled: false,
165170
siteKey: 'mock_site_key'
@@ -178,6 +183,9 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
178183
});
179184

180185
it('should handle MISSING_RECAPTCHA_TOKEN error when emailPasswordEnabled is false', async () => {
186+
if (typeof window === 'undefined') {
187+
return;
188+
}
181189
sinon.stub(mockAuthInstance, '_getRecaptchaConfig').returns({
182190
emailPasswordEnabled: false,
183191
siteKey: 'mock_site_key'
@@ -196,7 +204,6 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => {
196204

197205
expect(result).to.equal('success-after-recaptcha');
198206
expect(mockActionMethod).to.have.been.calledTwice;
199-
// Add more assertions as needed, e.g., checking if injectRecaptchaFields was called
200207
});
201208
});
202209
});

0 commit comments

Comments
 (0)