SW-3490 set metadata for routes * feat(SW-3490): Set metadata title for hotelreservation paths Approved-by: Anton Gunnarsson
28 lines
859 B
TypeScript
28 lines
859 B
TypeScript
import { describe, expect, it } from "vitest"
|
|
|
|
import { toCapitalCase } from "./toCapitalCase"
|
|
|
|
describe("toCapitalCase", () => {
|
|
it("should return same value for null or undefined", () => {
|
|
expect(toCapitalCase(null)).toBe(null)
|
|
expect(toCapitalCase(undefined)).toBe(undefined)
|
|
})
|
|
|
|
it("should return empty string for empty input", () => {
|
|
expect(toCapitalCase("")).toBe("")
|
|
})
|
|
|
|
it("should capitalize the first letter and lowercase the rest", () => {
|
|
expect(toCapitalCase("hello")).toBe("Hello")
|
|
expect(toCapitalCase("HELLO")).toBe("Hello")
|
|
expect(toCapitalCase("hElLo")).toBe("Hello")
|
|
expect(toCapitalCase("h")).toBe("H")
|
|
expect(toCapitalCase("H")).toBe("H")
|
|
})
|
|
|
|
it("should handle strings with spaces", () => {
|
|
expect(toCapitalCase(" hello ")).toBe("Hello")
|
|
expect(toCapitalCase(" ")).toBe("")
|
|
})
|
|
})
|