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

   Fixes #4028
   
   
   ## Summary
   
   Adds a focused Vitest regression test file at 
`web/src/pages/ops/__tests__/alertRulePayload.test.ts` covering legacy alert 
rule payload normalization. The tests lock the current behavior of 
`normalizeMetric`, `normalizeDuration`, `attachThresholdUnit`, and the exported 
`thresholdUnits` map from `web/src/pages/ops/alertRulePayload.ts`, including 
the mapping of legacy Chinese metric/duration labels to Prometheus 
names/durations.
   
   ## Why
   
   The existing suite does not cover legacy alert rule payload normalization. A 
regression in the label mapping or threshold-unit attachment would silently 
change the payloads sent for legacy alert rules, so the behavior is locked with 
a dedicated test file. No runtime behavior changes are made.
   
   ## Testing
   
   - Local type check: `cd web && ./node_modules/.bin/tsc -b tsconfig.app.json` 
(exit 0).
   - Targeted Vitest run: `cd web && ./node_modules/.bin/vitest run 
src/pages/ops/__tests__/alertRulePayload.test.ts` (all tests pass).
   


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