auto close menus on open guide
This commit is contained in:
@@ -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: '我的' }));
|
||||
|
||||
Reference in New Issue
Block a user