This is an automated email from the ASF dual-hosted git repository.

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new f22a5521b fix(web): stabilize cloud credential loading tests (#6619)
f22a5521b is described below

commit f22a5521b03fd695e7c9becebcbd40f314923350
Author: pilichoumao <[email protected]>
AuthorDate: Thu Oct 15 18:16:11 2026 +0800

    fix(web): stabilize cloud credential loading tests (#6619)
---
 web/src/pages/settings/__tests__/CloudCredentialTab.test.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/web/src/pages/settings/__tests__/CloudCredentialTab.test.tsx 
b/web/src/pages/settings/__tests__/CloudCredentialTab.test.tsx
index 56ff46441..a75d176b6 100644
--- a/web/src/pages/settings/__tests__/CloudCredentialTab.test.tsx
+++ b/web/src/pages/settings/__tests__/CloudCredentialTab.test.tsx
@@ -99,7 +99,7 @@ describe('CloudCredentialTab', () => {
   beforeEach(() => {
     vi.clearAllMocks();
     localStorage.removeItem(LANGUAGE_STORAGE_KEY);
-    vi.mocked(listCloudCredentials).mockResolvedValue(credentials);
+    vi.mocked(listCloudCredentials).mockReset().mockResolvedValue(credentials);
   });
 
   it('renders masked credentials from the backend', async () => {
@@ -212,7 +212,9 @@ describe('CloudCredentialTab', () => {
     expect(error.closest('.ant-alert')).not.toBeNull();
     expect(screen.queryByText('aliyun-test')).not.toBeInTheDocument();
     expect(screen.queryByRole('button', { name: /删除/ 
})).not.toBeInTheDocument();
-    
expect(document.querySelector('.ant-spin-spinning')).not.toBeInTheDocument();
+    await waitFor(() =>
+      
expect(document.querySelector('.ant-spin-spinning')).not.toBeInTheDocument(),
+    );
 
     await user.click(screen.getByRole('button', { name: /^重\s*试$/ }));
     expect(await screen.findByText('tencent-prod')).toBeInTheDocument();
@@ -241,7 +243,9 @@ describe('CloudCredentialTab', () => {
     const error = await screen.findByText('云凭据加载失败,请稍后重试');
     expect(error.closest('.ant-alert')).not.toBeNull();
     expect(screen.queryByText('aliyun-test')).not.toBeInTheDocument();
-    
expect(document.querySelector('.ant-spin-spinning')).not.toBeInTheDocument();
+    await waitFor(() =>
+      
expect(document.querySelector('.ant-spin-spinning')).not.toBeInTheDocument(),
+    );
 
     await user.click(screen.getByRole('button', { name: /^重\s*试$/ }));
     await waitFor(() => expect(listCloudCredentials).toHaveBeenCalledTimes(2));

Reply via email to