diff --git a/server/src/api/job/job.service.spec.ts b/server/src/api/job/job.service.spec.ts index a705b45..d763967 100644 --- a/server/src/api/job/job.service.spec.ts +++ b/server/src/api/job/job.service.spec.ts @@ -17,6 +17,7 @@ describe('JobController', () => { describe('create', () => { it('should return a new job', async () => { + const date = new Date(); const jobInput = { firstName: "John", lastName: "Doe", @@ -41,6 +42,8 @@ describe('JobController', () => { customerId: 1, paymentMethod: $Enums.PaymentMethod.CASH, userId: 1, + createdAt: date, + updatedAt: date } const mockCreateJobWithCustomerAndSchedules = jest.fn().mockResolvedValue(newJob) @@ -55,6 +58,7 @@ describe('JobController', () => { describe('findOne', () => { it('should return a single job', async () => { + const date = new Date(); const job = { id: 1, title: "Sample title 1", @@ -64,6 +68,8 @@ describe('JobController', () => { customerId: 1, paymentMethod: $Enums.PaymentMethod.CASH, userId: 1, + createdAt: date, + updatedAt: date } jest.spyOn(jobService, 'findOne').mockResolvedValue(job); @@ -76,6 +82,7 @@ describe('JobController', () => { describe('findAll', () => { it('should return an array of jobs', async () => { + const date = new Date(); const jobs = [{ id: 1, title: "Sample title 1", @@ -85,6 +92,8 @@ describe('JobController', () => { customerId: 1, paymentMethod: $Enums.PaymentMethod.CASH, userId: 1, + createdAt: date, + updatedAt: date }, { id: 2, title: "Sample title 2", @@ -94,6 +103,8 @@ describe('JobController', () => { customerId: 1, paymentMethod: $Enums.PaymentMethod.CARD, userId: 1, + createdAt: date, + updatedAt: date }]; jest.spyOn(jobService, 'findAll').mockResolvedValue(jobs) @@ -106,6 +117,7 @@ describe('JobController', () => { describe('createJob', () => { it('should return a new job', async () => { + const date = new Date(); const jobInput = { title: "Sample title 1", type: "A", @@ -125,6 +137,8 @@ describe('JobController', () => { paymentMethod: $Enums.PaymentMethod.CASH, customerId: 1, userId: 1, + createdAt: date, + updatedAt: date } jest.spyOn(jobService, 'createJob').mockResolvedValue(newJob)