import { expect, test } from "bun:test"; import { catalogueNumber, conditionOf, vitrineOf, VITRINES } from "./museum.ts"; test("sorts a description into its vitrine by keyword", () => { expect(VITRINES[vitrineOf("a single brown leather glove")]).toBe("Outerwear and Umbrellas"); expect(VITRINES[vitrineOf("a set of house keys on a red fob")]).toBe("Keys and Fastenings"); expect(VITRINES[vitrineOf("reading glasses, tortoiseshell frame")]).toBe("Spectacles and Lenses"); expect(VITRINES[vitrineOf("an iphone charger, white")]).toBe("Small Electronics"); expect(VITRINES[vitrineOf("a silver ring, engraved")]).toBe("Jewellery and Adornment"); expect(VITRINES[vitrineOf("a paperback book, dog-eared")]).toBe("Papers and Correspondence"); expect(VITRINES[vitrineOf("a stuffed teddy bear")]).toBe("Children's Effects"); }); test("falls back to Miscellanea when nothing matches", () => { expect(VITRINES[vitrineOf("a smooth grey stone")]).toBe("Miscellanea"); }); test("gives the same item the same condition every time", () => { expect(conditionOf(7)).toBe(conditionOf(7)); }); test("builds a catalogue number from the year and id", () => { expect(catalogueNumber(3, "2026-09-14 10:00:00")).toBe("LP 2026.0003"); });