From 03c2b3a379436144aa3e63b49b864bc7081d7576 Mon Sep 17 00:00:00 2001 From: Dopeamin Date: Tue, 1 Oct 2024 10:49:56 +0200 Subject: [PATCH] fixes old frontend api url tests --- Makefile | 2 +- tests/unit/session.test.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e4bc075..ea96bd7 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ test: .PHONY: unit_test unit_test: - @npx jest --coverage "tests/unit" + @npx jest --coverage "/tests/unit" .PHONY: cjs/build cjs/build: $(SOURCE_FILES) diff --git a/tests/unit/session.test.ts b/tests/unit/session.test.ts index 3529055..1c0d394 100644 --- a/tests/unit/session.test.ts +++ b/tests/unit/session.test.ts @@ -230,9 +230,9 @@ describe('Session Service Unit Tests', () => { ); }); - test('should return user using new Frontend API URL as issuer in JWT', async () => { + test('should return user using old Frontend API URL as issuer in JWT', async () => { const jwt = await generateJWT( - 'https://pro-2.frontendapi.corbado.io', + 'https://pro-2.frontendapi.cloud.corbado.io', 600, { sub: TEST_USER_ID, @@ -248,9 +248,16 @@ describe('Session Service Unit Tests', () => { }); }); - test('should return user using old Frontend API URL as issuer in JWT', async () => { - const jwt = await generateJWT( + test('should return user using old Frontend API URL as config issuer in JWT', async () => { + sessionService = new SessionService( + SHORT_SESSION_COOKIE_NAME, 'https://pro-2.frontendapi.cloud.corbado.io', + JWKS_URI, + 10, + PROJECT_ID, + ); + const jwt = await generateJWT( + 'https://pro-2.frontendapi.corbado.io', 600, { sub: TEST_USER_ID,