You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/03 14:51:01 UTC

[PR] fix(web): remove BrokerCluster mock fallback rows [rocketmq-dashboard]

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

   ### Summary
   
   - remove hard-coded Broker/NameServer/Proxy fallback rows from BrokerCluster
   - initialize infrastructure tables as empty until real cluster data loads
   - keep API failure reporting without showing local mock topology
   - update regression coverage so failed loads do not render mock infrastructure nodes
   
   ### Related Issue
   
   Fixes #870
   
   ### Tests
   
   - `npm test -- --run src/pages/studio/__tests__/BrokerCluster.test.tsx`
   - `npm run lint -- src/pages/studio/BrokerCluster.tsx src/pages/studio/__tests__/BrokerCluster.test.tsx` (passes with existing fast-refresh warnings)


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): remove BrokerCluster mock fallback rows [rocketmq-dashboard]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #871:
URL: https://github.com/apache/rocketmq-dashboard/pull/871#issuecomment-5175210948

   Superseded by consolidated PR #936, which contains this change and has passing checks. Closing this narrower PR to keep review focused.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): remove BrokerCluster mock fallback rows [rocketmq-dashboard]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #871:
URL: https://github.com/apache/rocketmq-dashboard/pull/871#discussion_r3705163990


##########
web/src/pages/studio/__tests__/BrokerCluster.test.tsx:
##########
@@ -183,12 +183,14 @@ describe('BrokerCluster Page', () => {
     expect(restartButtons.length).toBeGreaterThan(0);
   });
 
-  it('should fall back to mock data when the API fails', async () => {
+  it('does not show mock infrastructure data when the API fails', async () => {
     vi.mocked(listClusters).mockRejectedValueOnce(new Error('network error'));
     renderWithProviders(<BrokerCluster />);
-    // Initial state holds the mock fallback rows
     await waitFor(() => {
-      expect(screen.getByText('broker-a')).toBeInTheDocument();
+      expect(listClusters).toHaveBeenCalledTimes(1);
     });
+    expect(screen.queryByText('broker-a')).not.toBeInTheDocument();
+    expect(screen.queryByText('broker-b')).not.toBeInTheDocument();
+    expect(screen.queryByText('proxy-a')).not.toBeInTheDocument();
   });

Review Comment:
   This test asserts absence of a couple of broker/proxy mock nodes, but it doesn't cover the full regression surface described in the PR (Broker + NameServer + Proxy). Consider also asserting that a representative NameServer mock row (e.g., 'nameserver-a') is not rendered, and add an assertion that the API failure is still reported to the user (e.g., an error banner/toast/message), to ensure the failure path both avoids mock topology and still surfaces the error.



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): remove BrokerCluster mock fallback rows [rocketmq-dashboard]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed pull request #871: fix(web): remove BrokerCluster mock fallback rows
URL: https://github.com/apache/rocketmq-dashboard/pull/871


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org