auto close menus on open guide

This commit is contained in:
2026-07-17 14:04:24 +08:00
parent fe59040958
commit 9b3e2f279f
2 changed files with 12 additions and 2 deletions
@@ -168,7 +168,10 @@ function SidebarAccountMenu({
role="menuitem"
className={sidebarMenuItemClass}
onClick={
() => showNotice('使用指南')
() =>{
onClose();
showNotice('使用指南');
}
// TODO doc is not ready
}
>
@@ -326,7 +329,8 @@ export function Sidebar({
title="帮助"
className={sidebarHelpButtonClass}
onClick={() => {
onNoticeRequest('使用指南');
closeMenus();
onNoticeRequest('使用指南');
// TODO open the guide
// TODO doc is not ready
}}
@@ -1782,6 +1782,12 @@ describe('AI 游戏创作 App 界面边界', () => {
expect(screen.getByRole('menuitem', { name: '使用指南' })).not.toBeNull();
expect(screen.getByRole('menuitem', { name: '反馈联系' })).not.toBeNull();
expect(screen.getByRole('menuitem', { name: '退出登录' })).not.toBeNull();
fireEvent.click(screen.getByRole('button', { name: '帮助' }));
expect(screen.queryByRole('menuitem', { name: '使用指南' })).toBeNull();
expect(screen.getByRole('dialog', { name: '使用指南' })).not.toBeNull();
fireEvent.click(screen.getByRole('button', { name: '知道了' }));
fireEvent.click(screen.getByRole('button', { name: '我的' }));
fireEvent.pointerDown(screen.getByLabelText('首页输入'));
expect(screen.queryByRole('menuitem', { name: '使用指南' })).toBeNull();
fireEvent.click(screen.getByRole('button', { name: '我的' }));