mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
fix(webui): stabilize transcript menu interactions
This commit is contained in:
@@ -84,6 +84,20 @@ describe('FileBrowserContextMenu', () => {
|
||||
expect(open).toHaveBeenCalledWith(url, '_blank', 'noopener,noreferrer')
|
||||
})
|
||||
|
||||
it('keeps the menu open when the right button is released over Move to', () => {
|
||||
const onMoveTo = vi.fn()
|
||||
renderWithMenu(fileItem, { onMoveTo })
|
||||
|
||||
fireEvent.contextMenu(screen.getByTestId('context-trigger'))
|
||||
const moveTo = screen.getByRole('menuitem', { name: 'Move to' })
|
||||
fireEvent.pointerUp(moveTo, { button: 2, pointerType: 'mouse' })
|
||||
expect(onMoveTo).not.toHaveBeenCalled()
|
||||
expect(screen.getByRole('menu')).toBeTruthy()
|
||||
|
||||
fireEvent.click(moveTo)
|
||||
expect(onMoveTo).toHaveBeenCalledWith([fileItem])
|
||||
})
|
||||
|
||||
it('omits the new-tab action for a multi-item selection', () => {
|
||||
renderWithMenu(fileItem, {
|
||||
files: [fileItem, stackItem],
|
||||
|
||||
Reference in New Issue
Block a user