Skip to content

Commit 35a19d8

Browse files
committed
Updating unit test
1 parent 7bde67b commit 35a19d8

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

packages/auth/src/api/index.test.ts

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -603,31 +603,33 @@ describe('api/_performApiRequest', () => {
603603
});
604604
});
605605

606-
it('should throw exception when tenantConfig is not initialized and Regional Endpoint is used', async () => {
607-
await expect(
608-
_performApiRequest<typeof request, typeof serverResponse>(
609-
auth,
610-
HttpMethod.POST,
611-
RegionalEndpoint.EXCHANGE_TOKEN,
612-
request
613-
)
614-
).to.be.rejectedWith(
615-
FirebaseError,
616-
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
617-
);
618-
});
606+
context('throws Operation now allowed exception', () => {
607+
it('when tenantConfig is not initialized and Regional Endpoint is used', async () => {
608+
await expect(
609+
_performApiRequest<typeof request, typeof serverResponse>(
610+
auth,
611+
HttpMethod.POST,
612+
RegionalEndpoint.EXCHANGE_TOKEN,
613+
request
614+
)
615+
).to.be.rejectedWith(
616+
FirebaseError,
617+
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
618+
);
619+
});
619620

620-
it('should throw exception when tenantConfig is initialized and default Endpoint is used', async () => {
621-
await expect(
622-
_performApiRequest<typeof request, typeof serverResponse>(
623-
regionalAuth,
624-
HttpMethod.POST,
625-
Endpoint.SIGN_UP,
626-
request
627-
)
628-
).to.be.rejectedWith(
629-
FirebaseError,
630-
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
631-
);
621+
it('when tenantConfig is initialized and default Endpoint is used', async () => {
622+
await expect(
623+
_performApiRequest<typeof request, typeof serverResponse>(
624+
regionalAuth,
625+
HttpMethod.POST,
626+
Endpoint.SIGN_UP,
627+
request
628+
)
629+
).to.be.rejectedWith(
630+
FirebaseError,
631+
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
632+
);
633+
});
632634
});
633635
});

0 commit comments

Comments
 (0)