mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 19:53:59 -05:00
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 <git@innay.de>
This commit is contained in:
parent
1a6e525446
commit
9c7ab01016
1 changed files with 4 additions and 2 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue