Updates
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import lowerToTitleCase from "./lower-to-title-case";
|
||||
|
||||
describe("lowerToTitleCase", () => {
|
||||
test("converts snake_case to Title Case", () => {
|
||||
expect(lowerToTitleCase("hello_world")).toBe("Hello World");
|
||||
});
|
||||
|
||||
test("converts kebab-case to Title Case", () => {
|
||||
expect(lowerToTitleCase("hello-world")).toBe("Hello World");
|
||||
});
|
||||
|
||||
test("converts mixed snake-kebab", () => {
|
||||
expect(lowerToTitleCase("hello_world-test")).toBe("Hello World Test");
|
||||
});
|
||||
|
||||
test("handles single word", () => {
|
||||
expect(lowerToTitleCase("hello")).toBe("Hello");
|
||||
});
|
||||
|
||||
test("handles already title case", () => {
|
||||
expect(lowerToTitleCase("Hello")).toBe("Hello");
|
||||
});
|
||||
|
||||
test("handles empty string", () => {
|
||||
expect(lowerToTitleCase("")).toBe("");
|
||||
});
|
||||
|
||||
test("handles all uppercase input", () => {
|
||||
expect(lowerToTitleCase("HELLO_WORLD")).toBe("Hello World");
|
||||
});
|
||||
|
||||
test("handles mixed case input", () => {
|
||||
expect(lowerToTitleCase("hello_World")).toBe("Hello World");
|
||||
});
|
||||
|
||||
test("converts user type values correctly", () => {
|
||||
expect(lowerToTitleCase("super_admin")).toBe("Super Admin");
|
||||
expect(lowerToTitleCase("financial_secretary")).toBe("Financial Secretary");
|
||||
expect(lowerToTitleCase("primary_resident")).toBe("Primary Resident");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user