hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { expect, test } from "vitest"; |
| 2 | import { attemptLabel } from "./exam-labels"; |
| 3 | |
| 4 | test("shows used/max when the exam caps attempts", () => { |
| 5 | expect(attemptLabel({ attempts_used: 1, attempt: 1 }, 3)).toBe("1 / 3"); |
| 6 | }); |
| 7 | |
| 8 | test("unlimited attempts (max 0) falls back to the attempt count", () => { |
| 9 | expect(attemptLabel({ attempts_used: 2, attempt: 2 }, 0)).toBe("2"); |
| 10 | }); |
| 11 | |
| 12 | test("no attempt data renders a dash", () => { |
| 13 | expect(attemptLabel({}, 3)).toBe("—"); |
| 14 | }); |