hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import type { AppointmentStatus } from "@/api/client"; |
| 2 | import { appointmentStatusClass, appointmentStatusDotClass, appointmentStatusLabelKey } from "./appointment-status"; |
| 3 | |
| 4 | const STATUSES: AppointmentStatus[] = ["pending", "approved", "rejected", "cancelled"]; |
| 5 | |
| 6 | it("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 | |
| 13 | it("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 | }); |