Skip to content

Commit

Permalink
ENH: adds first and last name to user and fix the tests
Browse files Browse the repository at this point in the history
Co-authored-by: amanramoliya <70715941+amanramoliya@users.noreply.github.com>
  • Loading branch information
ShreyasMandlik and amanramoliya committed Sep 1, 2023
1 parent 33fec01 commit cc34b2c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "firstName" TEXT,
ADD COLUMN "lastName" TEXT;
2 changes: 2 additions & 0 deletions backend/prisma/schema.prisma
Expand Up @@ -15,6 +15,8 @@ enum Role {
model User {
id String @id @default(uuid())
eId String? @unique
firstName String?
lastName String?
role String?
clientTeam String?
projectTeam String?
Expand Down
2 changes: 2 additions & 0 deletions backend/src/auth/auth.controller.spec.ts
Expand Up @@ -48,6 +48,8 @@ describe('AuthController', () => {
clientTeam: 'abc',
roles: Role.Employee,
projectTeam: 'abc',
firstName:"ABC",
lastName:"XYZ",
});
const result = await controller.signup(user);
expect(service.signup).toBeCalledTimes(1);
Expand Down
14 changes: 14 additions & 0 deletions backend/src/auth/auth.service.spec.ts
Expand Up @@ -99,6 +99,8 @@ describe('AuthService', () => {
role: 'BQA',
clientTeam: 'abc',
roles: Role.Employee,
firstName:"ABC",
lastName:"XYZ",
});
const result = await service.signup(userDTO);
expect(prismaService.user.create).toBeCalledTimes(1);
Expand Down Expand Up @@ -136,6 +138,8 @@ describe('AuthService', () => {
clientTeam: 'abc',
roles: Role.Employee,
projectTeam: 'abc',
firstName:"ABC",
lastName:"XYZ",
};

jest
Expand Down Expand Up @@ -167,6 +171,8 @@ describe('AuthService', () => {
role: 'BQA',
clientTeam: 'abc',
roles: Role.Employee,
firstName:"ABC",
lastName:"XYZ",
});

jest
Expand Down Expand Up @@ -196,6 +202,8 @@ describe('AuthService', () => {
role: 'BQA',
clientTeam: 'abc',
roles: Role.Employee,
firstName:"ABC",
lastName:"XYZ",
});

jest
Expand Down Expand Up @@ -231,6 +239,8 @@ describe('AuthService', () => {
clientTeam: 'abc',
roles: Role.Employee,
projectTeam: 'abc',
firstName:"ABC",
lastName:"XYZ",
});

const mockResponse = {
Expand Down Expand Up @@ -263,6 +273,8 @@ describe('AuthService', () => {
role: 'BQA',
clientTeam: 'abc',
roles: Role.Employee,
firstName:"ABC",
lastName:"XYZ",
});

const mockResponse = {
Expand Down Expand Up @@ -304,6 +316,8 @@ describe('AuthService', () => {
role: 'BQA',
clientTeam: 'abc',
roles: Role.Employee,
firstName:"ABC",
lastName:"XYZ",
};

jest.spyOn(prismaService.user, 'update').mockResolvedValueOnce(mockUser);
Expand Down

0 comments on commit cc34b2c

Please sign in to comment.