From 78cab04c311c9979d091e5b9152cca3a2b188955 Mon Sep 17 00:00:00 2001 From: Antoine Moreaux Date: Thu, 19 Dec 2024 15:00:19 +0100 Subject: [PATCH 1/2] fix test --- .../auth/token/services/refresh-token.service.spec.ts | 11 +++++++++-- .../auth/token/services/refresh-token.service.ts | 1 + .../rename-custom-object.integration-spec.ts | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.spec.ts index 5ac7ada61581..a53238067de5 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.spec.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.spec.ts @@ -66,8 +66,15 @@ describe('RefreshTokenService', () => { describe('verifyRefreshToken', () => { it('should verify a refresh token successfully', async () => { const mockToken = 'valid-refresh-token'; - const mockJwtPayload = { jti: 'token-id', sub: 'user-id' }; - const mockAppToken = { id: 'token-id', revokedAt: null }; + const mockJwtPayload = { + jti: 'token-id', + sub: 'user-id', + }; + const mockAppToken = { + id: 'token-id', + workspaceId: 'workspace-id', + revokedAt: null, + }; const mockUser: Partial = { id: 'some-id', firstName: 'John', diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts index ea574709bb95..eee7fd845be5 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts @@ -90,6 +90,7 @@ export class RefreshTokenService { ); } + console.log('>>>>>>>>>>>>>>', token); // TODO: Delete this useless condition and error after March 31st 2025 if (!token.workspaceId) { throw new AuthException( diff --git a/packages/twenty-server/test/integration/metadata/suites/object-metadata/rename-custom-object.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/object-metadata/rename-custom-object.integration-spec.ts index 9eb5773b29fb..ac4d836b4981 100644 --- a/packages/twenty-server/test/integration/metadata/suites/object-metadata/rename-custom-object.integration-spec.ts +++ b/packages/twenty-server/test/integration/metadata/suites/object-metadata/rename-custom-object.integration-spec.ts @@ -5,8 +5,8 @@ import { createOneRelationMetadataFactory } from 'test/integration/metadata/suit import { deleteOneRelationMetadataItemFactory } from 'test/integration/metadata/suites/utils/delete-one-relation-metadata-factory.util'; import { fieldsMetadataFactory } from 'test/integration/metadata/suites/utils/fields-metadata-factory.util'; import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util'; -import { objectsMetadataFactory } from 'test/integration/metadata/suites/utils/objects-metadata-factory.util'; -import { updateOneObjectMetadataItemFactory } from 'test/integration/metadata/suites/utils/update-one-object-metadata-factory.util'; +import { updateOneObjectMetadataItemFactory } from 'test/integration/metadata/suites/object-metadata/utils/update-one-object-metadata-factory.util'; +import { objectsMetadataFactory } from 'test/integration/metadata/suites/object-metadata/utils/objects-metadata-factory.util'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; From c801d97e059176e6a2d5610da002e55ffa9b4eaf Mon Sep 17 00:00:00 2001 From: Antoine Moreaux Date: Thu, 19 Dec 2024 15:02:54 +0100 Subject: [PATCH 2/2] fix test --- .../core-modules/auth/token/services/refresh-token.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts index eee7fd845be5..ea574709bb95 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/refresh-token.service.ts @@ -90,7 +90,6 @@ export class RefreshTokenService { ); } - console.log('>>>>>>>>>>>>>>', token); // TODO: Delete this useless condition and error after March 31st 2025 if (!token.workspaceId) { throw new AuthException(