复用项目页错误提示组件

项目页读取失败提示改为复用 PlatformStatusMessage

删除项目页局部错误提示视觉样式

补充项目页错误状态测试和 TRACKING 记录
This commit is contained in:
2026-06-14 02:26:59 +08:00
parent 83ebda4dc2
commit 53b12b4cda
4 changed files with 21 additions and 9 deletions

View File

@@ -67,6 +67,18 @@ describe('ProjectGalleryView', () => {
expect(onOpenProject).toHaveBeenCalledWith('editor-project-1');
});
it('renders project loading errors through the shared status message', async () => {
listEditorProjectsMock.mockRejectedValueOnce(new Error('读取项目失败'));
render(<ProjectGalleryView onOpenProject={vi.fn()} />);
const alert = await screen.findByRole('alert');
expect(alert.textContent).toContain('读取项目失败');
expect(alert.className).toContain('platform-status-message');
expect(alert.className).toContain('project-gallery__error');
});
it('renames and deletes a project from the hover menu', async () => {
listEditorProjectsMock.mockResolvedValueOnce(projectItems);
renameEditorProjectMock.mockResolvedValueOnce({