test: pin customer-name search to the name column
Runner Test / test (push) Successful in 16s
Runner Test / test (pull_request) Successful in 15s

Search "JOHN SMITH" instead of "JOHN" so the regression test only matches
through the customer name column ("john" alone also matched the email),
ensuring case-insensitive name matching is verified on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUfxyr6EcRi4EYSX1wLoRh
This commit is contained in:
shawn
2026-09-11 15:05:31 +10:00
co-authored by Claude Opus 5
parent 94ebd0733a
commit e0972d80fa
+1 -1
View File
@@ -45,7 +45,7 @@ describe("order routes", () => {
}); });
test("finds orders by customer name regardless of letter case", async () => { test("finds orders by customer name regardless of letter case", async () => {
const response = await app.inject({ method: "GET", url: "/api/orders?query=JOHN", headers: { cookie: employeeCookie } }); const response = await app.inject({ method: "GET", url: "/api/orders?query=JOHN%20SMITH", headers: { cookie: employeeCookie } });
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
expect(response.json().map((order: { orderNumber: string }) => order.orderNumber)).toEqual(["ORD-1001", "ORD-1003"]); expect(response.json().map((order: { orderNumber: string }) => order.orderNumber)).toEqual(["ORD-1001", "ORD-1003"]);