forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

appointment-status.test.ts22 lines, 855 bytesHistoryRawDownload
1import type { AppointmentStatus } from "@/api/client";
2import { appointmentStatusClass, appointmentStatusDotClass, appointmentStatusLabelKey } from "./appointment-status";
3
4const STATUSES: AppointmentStatus[] = ["pending", "approved", "rejected", "cancelled"];
5
6it("maps each status to a non-empty class and dot class", () => {
7 for (const status of STATUSES) {
8 expect(appointmentStatusClass(status).length).toBeGreaterThan(0);
9 expect(appointmentStatusDotClass(status).length).toBeGreaterThan(0);
10 }
11});
12
13it("gives each status a distinct label key", () => {
14 const keys = STATUSES.map(appointmentStatusLabelKey);
15 expect(new Set(keys).size).toBe(STATUSES.length);
16 expect(keys).toEqual([
17 "appointments.status.pending",
18 "appointments.status.approved",
19 "appointments.status.rejected",
20 "appointments.status.cancelled",
21 ]);
22});