Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Nov 21, 2024
1 parent bb8ef8b commit 51d6a1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/bookings/bookings.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing';
import { BookingsService } from './bookings.service';
import { getRepositoryToken } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Repository, MoreThan, In } from 'typeorm';
import { Booking, BookingStatus } from './entities/booking.entity';
import { UsersService } from '../users/users.service';
import { EmployeesService } from '../employees/employees.service';
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('BookingsService', () => {
});

describe('findUpcoming', () => {
it('should return upcoming confirmed bookings', async () => {
it('should return upcoming pending and confirmed bookings', async () => {
const mockBookings = [{ id: 'booking-1' }, { id: 'booking-2' }];
mockBookingRepository.find.mockResolvedValue(mockBookings);

Expand All @@ -244,7 +244,7 @@ describe('BookingsService', () => {
expect(mockBookingRepository.find).toHaveBeenCalledWith({
where: {
startTime: expect.any(Object),
status: BookingStatus.CONFIRMED,
status: In([BookingStatus.PENDING, BookingStatus.CONFIRMED]),
},
relations: ['customer', 'employee', 'employee.user', 'service'],
order: { startTime: 'ASC' },
Expand Down

0 comments on commit 51d6a1b

Please sign in to comment.