mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
refactor: adapt for typeorm 0.3
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a07b5f54d1
commit
c4975e4783
21 changed files with 131 additions and 69 deletions
|
@ -108,7 +108,7 @@ describe('AuthService', () => {
|
|||
});
|
||||
describe('fails:', () => {
|
||||
it('AuthToken could not be found', async () => {
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(undefined);
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(null);
|
||||
await expect(
|
||||
service.getAuthTokenAndValidate(authToken.keyId, token),
|
||||
).rejects.toThrow(NotInDBError);
|
||||
|
@ -157,7 +157,7 @@ describe('AuthService', () => {
|
|||
await service.setLastUsedToken(authToken.keyId);
|
||||
});
|
||||
it('throws if the token is not in the database', async () => {
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(undefined);
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(null);
|
||||
await expect(service.setLastUsedToken(authToken.keyId)).rejects.toThrow(
|
||||
NotInDBError,
|
||||
);
|
||||
|
@ -226,7 +226,7 @@ describe('AuthService', () => {
|
|||
await service.removeToken(authToken.keyId);
|
||||
});
|
||||
it('throws if the token is not in the database', async () => {
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(undefined);
|
||||
jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(null);
|
||||
await expect(service.removeToken(authToken.keyId)).rejects.toThrow(
|
||||
NotInDBError,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue