Merge pull request #1612 from hedgedoc/fix-toAuthTokenDtoTest

Fix copy paste error in auth toAuthTokenDto test
This commit is contained in:
David Mehren 2021-09-04 17:12:06 +02:00 committed by GitHub
commit dc6d9dfc20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(),