Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Jan 26, 2025
1 parent d21da3a commit 36d561a
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions backend/src/bookings/bookings.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,35 @@ import { CreateBookingDto } from "./dto/create-booking.dto";
import { CreateWalkInBookingDto } from "./dto/create-walk-in-booking.dto";
import { UpdateBookingDto } from "./dto/update-booking.dto";
import { NotFoundException, BadRequestException } from "@nestjs/common";
import { UserRole } from "../users/entities/user.entity";

describe("BookingsService", () => {
let service: BookingsService;

interface MockBooking extends Partial<Booking> {
interface MockUser {
id: string;
customer?: { firstName: string };
firstName: string;
lastName: string;
email: string;
password: string;
role: UserRole;
phoneNumber: string | null;
createdAt: Date;
updatedAt: Date;
}

interface MockBooking {
id: string;
customer?: Partial<MockUser>;
service?: { id: string; duration: number };
employee?: { id: string };
status?: BookingStatus;
startTime?: Date;
endTime?: Date;
notes?: string;
totalPrice?: number;
cancelledAt?: Date;
cancellationReason?: string;
}

const mockBookingRepository = {
Expand Down

0 comments on commit 36d561a

Please sign in to comment.