mirror of
https://gitlab.com/mobicoop/v3/service/user.git
synced 2026-03-27 14:05:51 +00:00
add phone
This commit is contained in:
@@ -9,10 +9,10 @@ import { CreateUserUseCase } from '../../domain/usecases/create-user.usecase';
|
||||
import { UserProfile } from '../../mappers/user.profile';
|
||||
|
||||
const newUserRequest: CreateUserRequest = {
|
||||
uuid: 'bb281075-1b98-4456-89d6-c643d3044a91',
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
email: 'john.doe@email.com',
|
||||
phone: '0601020304',
|
||||
};
|
||||
const newUserCommand: CreateUserCommand = new CreateUserCommand(newUserRequest);
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('CreateUserUseCase', () => {
|
||||
});
|
||||
|
||||
describe('execute', () => {
|
||||
it('should create an User and returns new entity object', async () => {
|
||||
it('should create and return a new user', async () => {
|
||||
const newUser: User = await createUserUseCase.execute(newUserCommand);
|
||||
|
||||
expect(newUser.lastName).toBe(newUserRequest.lastName);
|
||||
|
||||
@@ -9,18 +9,21 @@ const mockUsers = [
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
email: 'john.doe@email.com',
|
||||
phone: '0601020304',
|
||||
},
|
||||
{
|
||||
uuid: 'bb281075-1b98-4456-89d6-c643d3044a92',
|
||||
firstName: 'Jane',
|
||||
lastName: 'Doe',
|
||||
email: 'jane.doe@email.com',
|
||||
phone: '0602030405',
|
||||
},
|
||||
{
|
||||
uuid: 'bb281075-1b98-4456-89d6-c643d3044a93',
|
||||
firstName: 'Jimmy',
|
||||
lastName: 'Doe',
|
||||
email: 'jimmy.doe@email.com',
|
||||
phone: '0603040506',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -57,7 +60,7 @@ describe('DeleteUserUseCase', () => {
|
||||
});
|
||||
|
||||
describe('execute', () => {
|
||||
it('should delete an User', async () => {
|
||||
it('should delete a user', async () => {
|
||||
const savedUuid = mockUsers[0].uuid;
|
||||
const deleteUserCommand = new DeleteUserCommand(savedUuid);
|
||||
await deleteUserUseCase.execute(deleteUserCommand);
|
||||
|
||||
@@ -9,18 +9,21 @@ const mockUsers = [
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
email: 'john.doe@email.com',
|
||||
phone: '0601020304',
|
||||
},
|
||||
{
|
||||
uuid: 'bb281075-1b98-4456-89d6-c643d3044a92',
|
||||
firstName: 'Jane',
|
||||
lastName: 'Doe',
|
||||
email: 'jane.doe@email.com',
|
||||
phone: '0602030405',
|
||||
},
|
||||
{
|
||||
uuid: 'bb281075-1b98-4456-89d6-c643d3044a93',
|
||||
firstName: 'Jimmy',
|
||||
lastName: 'Doe',
|
||||
email: 'jimmy.doe@email.com',
|
||||
phone: '0603040506',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ const mockUser = {
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
email: 'john.doe@email.com',
|
||||
phone: '0601020304',
|
||||
};
|
||||
|
||||
const mockUserRepository = {
|
||||
|
||||
Reference in New Issue
Block a user