Aman-Mittal opened a new pull request, #390:
URL: https://github.com/apache/fineract-backoffice-ui/pull/390

   The header's global search is the only control that reaches any entity from 
any screen, and it had no end-to-end cover at all. 
`e2e/global-search-navigation.spec.ts` adds it, mocked throughout, so it runs 
in the `mocked` project without a Fineract stack.
   
   ## What is covered
   
   The point is not that a request goes out — it is the three things the 
component does around the request, none of which a unit test of the service can 
see:
   
   - **the two-character floor** — Fineract rejects a one-character search, so 
the guard is what keeps the first keystroke of every search off the wire. 
Asserted by recording requests and expecting none.
   - **the debounce** — a phrase typed straight through is one request, not one 
per keystroke, against an endpoint that searches clients, loans and savings on 
every call.
   - **the delayed dismissal** — `onSearchBlur` hides the dropdown on a 150ms 
timer specifically so blur does not unmount the item being clicked. That is a 
real race and it only reproduces in a browser.
   
   Plus routing per entity type, and the two states that are easy to get wrong: 
the query is cleared after a selection (a query left in the box reopens stale 
results over whatever screen you just landed on), and no dropdown is rendered 
at all when there are no matches.
   
   ## The fix
   
   Writing the savings case turned up a live bug. Selecting a savings account 
navigated to `/savings/view/:id`, and there is no top-level `savings` route — 
savings accounts are served under products as `savings-accounts/view/:id`. The 
navigation matched the `**` wildcard and dropped the user on Not Found. Clients 
and loans were always fine, which is presumably why it went unnoticed.
   
   Fixed in its own commit ahead of the spec, so it can be reverted or 
cherry-picked independently.
   
   ## Verified
   
   `lint`, `format:check` and `typecheck:e2e` clean. The spec itself needs a 
browser run in CI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to