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

   ### Motivation
   
   The consumer lag helpers had three tests covering the headline behaviors but 
left the default unavailable label, negative and non-finite lags, and 
locale-consistent numeric rendering unasserted. This PR grows the suite from 3 
to 8 cases.
   
   ### Changes
   
   - `formatLag` without an explicit label falls back to the `-1` sentinel 
string for `UNKNOWN_LAG`, `null`, and `undefined`.
   - Negative lags (including negative infinity) are unavailable and render the 
provided label.
   - Numeric rendering stays consistent with `toLocaleString` for large values.
   - Positive infinity and `NaN` are unavailable across `isLagAvailable`, 
`formatLag`, and `lagSortValue`.
   - Zero remains the smallest available lag, sorting before any positive value.
   
   ### Verification
   
   - `vitest run src/utils/consumerLag.test.ts`: 8/8 passed
   - `tsc --noEmit`: clean
   - `eslint src/utils/consumerLag.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