import { describe, expect, it } from "vitest"; import { normalizeRecentResults, normalizeSearchResults } from "./request-results"; describe("request result normalization", () => { it("replaces placeholder request titles", () => { expect(normalizeRecentResults([{ id: 42, title: "Request 42", year: 2024 }])).toEqual([ expect.objectContaining({ id: 42, title: "Request #42", year: 2024 }), ]); }); it("drops malformed search results", () => { expect(normalizeSearchResults([null, { title: "" }, { title: "Drive", requestId: 3991 }])).toEqual([ expect.objectContaining({ title: "Drive", requestId: 3991 }), ]); }); });