保存本地对routes.ts的修改
Change-Id: I4f4dbd8069893d7363e251130791dc0594be44e1
diff --git a/src/test/category/OtherCategory.test.tsx b/src/test/category/OtherCategory.test.tsx
new file mode 100644
index 0000000..dd1e793
--- /dev/null
+++ b/src/test/category/OtherCategory.test.tsx
@@ -0,0 +1,32 @@
+import { render, screen } from '@testing-library/react';
+import OtherCategory from '../../feature/categories/OtherCategory';
+import { Provider } from 'react-redux';
+import { store } from '../../store/store';
+import { MemoryRouter } from 'react-router';
+
+describe('OtherCategory Component', () => {
+ it('renders other resources category page with search and resource cards', () => {
+ render(
+ <MemoryRouter>
+ <Provider store={store}>
+ <OtherCategory />
+ </Provider>
+ </MemoryRouter>
+ );
+
+ // 验证标题和描述
+ expect(screen.getByText('其他资源分区')).toBeInTheDocument();
+ expect(screen.getByText('软件、电子书等其他类型资源')).toBeInTheDocument();
+
+ // 验证搜索框
+ const searchInput = screen.getByPlaceholderText('搜索资源名称或描述');
+ expect(searchInput).toBeInTheDocument();
+
+ // 验证资源卡片
+ expect(screen.getByText('盗梦空间')).toBeInTheDocument();
+ expect(screen.getByText('肖申克的救赎')).toBeInTheDocument();
+
+ // 验证类型信息
+ expect(screen.getByText('类型: 未知类型')).toBeInTheDocument();
+ });
+});
\ No newline at end of file