mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +00:00
feat(file-browser): add context-aware copy submenu (#517)
* feat(file-browser): add context-aware copy submenu * refactor(file-browser): address code review feedback for copy submenu * fix(webui): align submenu trigger text and widen file context menu * test(e2e): guard clipboard permissions in copy-menu spec for cross-browser support
This commit is contained in:
@@ -80,4 +80,19 @@ describe('FileBrowserContextMenu', () => {
|
||||
|
||||
expect(screen.queryByText(/Manage versions|管理版本/i)).toBeNull()
|
||||
})
|
||||
|
||||
it('renders Copy submenu trigger for regular file item with aligned gap-2 and w-52 menu width', () => {
|
||||
renderWithMenu(fileItem)
|
||||
|
||||
fireEvent.contextMenu(screen.getByTestId('context-trigger'))
|
||||
|
||||
const copyOption = screen.getByText(/^Copy$|^复制$/i)
|
||||
expect(copyOption).toBeTruthy()
|
||||
|
||||
const trigger = copyOption.closest('[data-slot="context-menu-sub-trigger"]')
|
||||
expect(trigger?.className).toContain('gap-2')
|
||||
|
||||
const menuContent = copyOption.closest('[data-slot="context-menu-content"]')
|
||||
expect(menuContent?.className).toContain('w-52')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user