chore: standardize security and quality foundations
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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 }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user