zjncs opened a new issue, #5633:
URL: https://github.com/apache/rocketmq-dashboard/issues/5633

   ## Description
   
   `AlertsPage.test.tsx`'s `refreshes metric options from the selected instance 
capabilities` (line 441) is a **strict subset** of the business-metrics test at 
408-439: its sole assertion (`listNativeAlertMetrics` called with `('local', 
'BUSINESS')`, line 457) is asserted by the 408 test (line 433) **plus** the 
heading, the rules API call, the disabled-until-instance state, the 
consumer-group field, and the rendered metric options. No instance change ever 
happens in the 441 test, so the "refresh" its title promises is never exercised.
   
   Meanwhile the failure branch of `loadMetricCapabilities` 
(`alerts.tsx:481-485`) — a rejected capabilities fetch surfacing 
`alerts.metricLoadFailed` and leaving the modal usable — is covered by **no 
test at all**.
   
   ## Expected behavior
   
   Replace the vacuous duplicate with coverage of the untested failure branch: 
select an instance whose capabilities fetch rejects, assert the error toast 
renders and the metric selector remains present (the modal does not crash or 
wedge in a loading state).
   
   ## Environment
   
   - branch: master (0228dad5)
   - file: `web/src/pages/ops/__tests__/AlertsPage.test.tsx` (~441-458, 
test-only)


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