yyqdbngt opened a new pull request, #3871:
URL: https://github.com/apache/rocketmq-dashboard/pull/3871

   ### Motivation
   
   The `connectionsService` unit tests only exercised the mock-data branch, 
leaving the real-mode delegation path and several edge semantics untested. This 
PR expands the suite from 6 to 12 cases covering both branches.
   
   ### Changes
   
   - Switch the `dataMode` module mock to a hoisted, per-test switchable stub 
so both mock and real execution modes can be asserted in the same file.
   - Add real-mode cases asserting the service delegates to 
`api.listConnections` (call count, verbatim query forwarding, and results 
surfaced even for a NameServer the mock inventory has never seen).
   - Add mock-mode cases: padded NameServer addresses resolve to the owning 
cluster after trimming, a Producer type filter narrows the preproduction 
inventory, and protocol values (e.g. `Remoting`) never satisfy the `type` 
filter even though matching clients exist.
   - Keep existing defensive-copy, cross-cluster isolation, and 
filter-normalization assertions intact.
   
   ### Verification
   
   - `vitest run src/services/connectionsService.test.ts`: 12/12 passed
   - `tsc --noEmit`: clean
   - `eslint src/services/connectionsService.test.ts`: clean


-- 
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