test(workspace): align project menu edge assertion
This commit is contained in:
@@ -402,7 +402,7 @@ describe('ProjectSwitcher runtime fields', () => {
|
||||
expect(menu.closest('.floating-portal')?.parentElement).toBe(document.body)
|
||||
const surface = screen.getByRole('dialog', { name: '项目与活动' })
|
||||
expect(surface.style.width).toBe('680px')
|
||||
expect(surface.style.left).toBe('14px')
|
||||
expect(surface.style.left).toBe('16px')
|
||||
const selected = within(menu).getByRole('menuitemradio', { checked: true })
|
||||
await waitFor(() => expect(screen.getByRole('tab', { name: '全部项目' })).toHaveFocus())
|
||||
fireEvent.pointerDown(selected)
|
||||
@@ -411,7 +411,7 @@ describe('ProjectSwitcher runtime fields', () => {
|
||||
const width = vi.spyOn(window, 'innerWidth', 'get').mockReturnValue(360)
|
||||
fireEvent(window, new Event('resize'))
|
||||
expect(surface.style.width).toBe('328px')
|
||||
expect(surface.style.left).toBe('14px')
|
||||
expect(surface.style.left).toBe('16px')
|
||||
width.mockRestore()
|
||||
fireEvent.keyDown(selected, { key: 'Escape' })
|
||||
expect(screen.queryByRole('menu')).not.toBeInTheDocument()
|
||||
|
||||
Reference in New Issue
Block a user