From 9c7ab0101676b100f0aa8b4f0a50bd8315e381c8 Mon Sep 17 00:00:00 2001 From: Yannick Bungers Date: Fri, 3 Sep 2021 19:15:42 +0200 Subject: [PATCH] Fix copy paste error in auth toAuthTokenDto test Add an hour difference between createdAt and validUntil to better detect these errors. Signed-off-by: Yannick Bungers --- src/auth/auth.service.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/auth/auth.service.spec.ts b/src/auth/auth.service.spec.ts index cb63af4f0..f7aaba855 100644 --- a/src/auth/auth.service.spec.ts +++ b/src/auth/auth.service.spec.ts @@ -318,14 +318,16 @@ describe('AuthService', () => { const authToken = new AuthToken(); authToken.keyId = 'testKeyId'; authToken.label = 'testLabel'; - authToken.createdAt = new Date(); + const date = new Date(); + date.setHours(date.getHours() - 1); + authToken.createdAt = date; authToken.validUntil = new Date(); const tokenDto = service.toAuthTokenDto(authToken); expect(tokenDto.keyId).toEqual(authToken.keyId); expect(tokenDto.lastUsed).toBeNull(); expect(tokenDto.label).toEqual(authToken.label); expect(tokenDto.validUntil.getTime()).toEqual( - authToken.createdAt.getTime(), + authToken.validUntil.getTime(), ); expect(tokenDto.createdAt.getTime()).toEqual( authToken.createdAt.getTime(),