为项目页增加返回主站入口
在项目页头部增加返回主站按钮。 将返回动作接入平台首页路由。 补充项目页返回主站测试与文档说明。
This commit is contained in:
@@ -9251,6 +9251,22 @@ test('desktop project tab switch clears creation primary styling', async () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('project page header can return to main site', async () => {
|
||||
const user = userEvent.setup();
|
||||
mockDesktopPlatformLayout();
|
||||
window.history.replaceState(null, '', '/project');
|
||||
render(<TestWrapper withAuth />);
|
||||
|
||||
expect(await screen.findByRole('main', { name: '项目' })).toBeTruthy();
|
||||
|
||||
await user.click(screen.getByRole('button', { name: '返回主站' }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole('main', { name: '项目' })).toBeNull();
|
||||
});
|
||||
expect(window.location.pathname).toBe('/');
|
||||
});
|
||||
|
||||
test('direct mobile creation home keeps landing content without mobile nav entry', async () => {
|
||||
window.history.replaceState(null, '', '/creation');
|
||||
const { container } = render(<TestWrapper withAuth />);
|
||||
|
||||
Reference in New Issue
Block a user