diff --git a/packages/auth/src/accessToken/service.test.ts b/packages/auth/src/accessToken/service.test.ts index daff1ba31b..a5ca0f8d6f 100644 --- a/packages/auth/src/accessToken/service.test.ts +++ b/packages/auth/src/accessToken/service.test.ts @@ -93,9 +93,13 @@ describe('Access Token Service', (): void => { }) test('Can get an access token by its managementId', async (): Promise => { + const retrievedGrant = await Grant.query(trx).findById(grant.id) await expect( accessTokenService.getByManagementId(accessToken.managementId) - ).resolves.toMatchObject(accessToken) + ).resolves.toMatchObject({ + ...accessToken, + grant: retrievedGrant + }) }) test('Cannot get an access token that does not exist', async (): Promise => { diff --git a/packages/auth/src/signature/middleware.test.ts b/packages/auth/src/signature/middleware.test.ts index 8d736a3785..f3bf8a70f5 100644 --- a/packages/auth/src/signature/middleware.test.ts +++ b/packages/auth/src/signature/middleware.test.ts @@ -229,8 +229,10 @@ describe('Signature Service', (): void => { expect(next).toHaveBeenCalled() expect(ctx.response.status).toEqual(200) - expect(ctx.accessToken).toMatchObject(token) - expect(ctx.accessToken.grant).toEqual(grant) + expect(ctx.accessToken).toMatchObject({ + ...token, + grant + }) scope.done() })