test(contacts): pin company search to substring ILIKE, not leading prefix #279
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-372-company-search-substring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PMS-372 reported that the company picker's GET /contacts/companies?q= matched only a leading prefix, so the exact full multi-word name and interior words returned zero rows. Investigation of the current backend shows list_companies already binds the search term as ILIKE %q% (src/modules/contacts/service.rs), which is a case-insensitive substring match, so the acceptance criteria are already met by the code; the reported prefix-only behaviour does not reproduce against main.
This adds a regression test covering all three acceptance criteria so the substring semantics cannot silently regress to a leading-prefix match: the exact full name (
ZQA live), an interior word matched case-insensitively across multiple companies (live->ZQA liveandAcme Live Corp, excluding unrelated rows), and a leading prefix (ZQA) all return the expected companies. Verified passing against the dev Postgres.#PMS-372