yyqdbngt opened a new pull request, #3882: URL: https://github.com/apache/rocketmq-dashboard/pull/3882
### Motivation The `alertRulePayload` helpers had three tests exercising unit derivation and one legacy normalization path, leaving unknown metrics, per-family units, legacy durations, and the duration omission rule unasserted. This PR grows the suite from 3 to 10 cases. ### Changes - An unknown metric passes through unchanged with an empty `thresholdUnit`. - Every known metric family resolves its unit (`%`, `条`, `TPS`, `个`). - A legacy metric is normalized while an unknown legacy duration label stays untouched. - All four known legacy duration labels (`1分钟`, `5分钟`, `15分钟`, `30分钟`) map to their `m` forms. - Payloads without a duration omit the field entirely instead of carrying an empty one. - `normalizeMetric`/`normalizeDuration` pass non-legacy values through and map every legacy metric label to its backend key. ### Verification - `vitest run src/pages/ops/__tests__/alerts.test.ts`: 10/10 passed - `tsc --noEmit`: clean - `eslint src/pages/ops/__tests__/alerts.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]
