test: pin customer-name search to the name column
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:
@@ -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"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user