diff --git a/src/components/AnnouncementDetail.test.jsx b/src/components/AnnouncementDetail.test.jsx
index 7f44ecd..5a68ecf 100644
--- a/src/components/AnnouncementDetail.test.jsx
+++ b/src/components/AnnouncementDetail.test.jsx
@@ -21,32 +21,25 @@
     id: 1,
     title: '测试公告标题',
     content: '这是测试公告内容\n这是第二行内容',
-    
     createTime: '2023-01-01T00:00:00Z',
-    
   };
 
   beforeEach(() => {
-    // 重置 mock 函数
     mockNavigate.mockClear();
-    
+
     // 设置模拟的 API 响应
     announcementApi.getAnnouncementDetail.mockResolvedValue({
       data: {
         code: 200,
         data: {
-          announcement: mockAnnouncement
-        }
-      }
+          announcement: mockAnnouncement,
+        },
+      },
     });
 
-    // 模拟 useParams
+    // 模拟钩子
     useParams.mockReturnValue({ id: '1' });
-
-    // 模拟 useLocation
-    useLocation.mockReturnValue({
-      state: { fromTab: 'announcement' }
-    });
+    useLocation.mockReturnValue({ state: { fromTab: 'announcement' } });
   });
 
   const renderComponent = () => {
@@ -54,7 +47,6 @@
       <MemoryRouter initialEntries={['/announcement/1']}>
         <Routes>
           <Route path="/announcement/:id" element={<AnnouncementDetail />} />
-          {/* 添加一个模拟的公告列表路由用于导航测试 */}
           <Route path="/dashboard/announcement" element={<div>公告列表</div>} />
         </Routes>
       </MemoryRouter>
@@ -64,9 +56,6 @@
   it('应该正确加载和显示公告详情', async () => {
     renderComponent();
 
-    
-
-    // 等待数据加载完成
     await waitFor(() => {
       expect(screen.getByText('测试公告标题')).toBeInTheDocument();
       expect(screen.getByText('这是测试公告内容')).toBeInTheDocument();
@@ -75,12 +64,8 @@
   });
 
   it('应该处理公告加载失败的情况', async () => {
-    // 模拟 API 返回错误
     announcementApi.getAnnouncementDetail.mockResolvedValue({
-      data: {
-        code: 404,
-        message: '公告不存在'
-      }
+      data: { code: 404, message: '公告不存在' },
     });
 
     renderComponent();
@@ -92,19 +77,18 @@
 
   it('应该能够返回公告区', async () => {
     renderComponent();
-  
+
     await waitFor(() => {
       expect(screen.getByText('测试公告标题')).toBeInTheDocument();
     });
-  
+
     fireEvent.click(screen.getByRole('button', { name: /返回/i }));
-  
+
     // 检查是否导航回公告区
     expect(mockNavigate).toHaveBeenCalledWith('/dashboard/announcement');
   });
 
   it('应该显示加载错误时的UI', async () => {
-    // 模拟 API 抛出错误
     announcementApi.getAnnouncementDetail.mockRejectedValue(new Error('网络错误'));
 
     renderComponent();
@@ -113,4 +97,30 @@
       expect(screen.getByText('获取公告详情失败')).toBeInTheDocument();
     });
   });
-});
\ No newline at end of file
+
+  // 边界测试 - 测试公告ID不存在
+  it('应该处理不存在的公告ID', async () => {
+    announcementApi.getAnnouncementDetail.mockResolvedValue({
+      data: { code: 404, message: '公告不存在' },
+    });
+
+    renderComponent();
+
+    await waitFor(() => {
+      expect(screen.getByText('公告不存在')).toBeInTheDocument();
+    });
+  });
+
+  // 边界测试 - 测试其他API错误
+  it('应该处理服务器错误', async () => {
+    announcementApi.getAnnouncementDetail.mockResolvedValue({
+      data: { code: 500, message: '服务器错误' },
+    });
+
+    renderComponent();
+
+    await waitFor(() => {
+      expect(screen.getByText('服务器错误')).toBeInTheDocument();
+    });
+  });
+});
