File size: 623 Bytes
92a1d83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { describe, expect, it } from "bun:test";
import { formatLabel } from "../format";

describe("formatLabel", () => {
  it("converts snake_case to Title Case", () => {
    expect(formatLabel("multiple_choice")).toBe("Multiple Choice");
    expect(formatLabel("true_false_not_given")).toBe("True False Not Given");
  });

  it("handles single word", () => {
    expect(formatLabel("cloze")).toBe("Cloze");
  });

  it("handles empty string", () => {
    expect(formatLabel("")).toBe("");
  });

  it("handles already spaced string", () => {
    expect(formatLabel("multiple choice")).toBe("Multiple Choice");
  });
});