proxy conf

This commit is contained in:
Bastian Wagner
2024-12-06 14:45:54 +01:00
parent a8f9f111d2
commit 82b02001e4
4 changed files with 75 additions and 4 deletions

View File

@@ -0,0 +1,50 @@
import { CreateUserDto } from "src/model/dto/create-user.dto";
import { User } from "src/model/entitites";
import { IUser } from "src/model/interface";
export class MockUserRepository {
user: User = {
firstName: null,
lastName: null,
id: 'mockId',
username: 'mockuser@test.de',
createdAt: undefined,
lastLogin: undefined,
external: {
externalId: 'externalid',
user: null,
accessToken: "",
refreshToken: ""
},
isActive: false,
role: null,
systems: []
}
findByUsername = jest.fn().mockImplementation((username: string) => {
return this.user;
})
createUser = jest.fn().mockImplementation((register: CreateUserDto) => {
const user: User = {
firstName: null,
lastName: null,
id: 'mockId',
username: register.username,
createdAt: undefined,
lastLogin: undefined,
external: {
externalId: register.externalId,
user: null,
accessToken: "",
refreshToken: ""
},
isActive: false,
role: null,
systems: []
}
return user;
})
}