mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🐛 Don't attempt to copy items that aren't copyable
This commit is contained in:
@@ -499,6 +499,21 @@ describe('WorkspaceElement', () => {
|
||||
expect(workspace.paneForItem(item)).toBe(startingPane)
|
||||
})
|
||||
})
|
||||
|
||||
describe("when the item doesn't implement a `copy` function", () => {
|
||||
it('does not copy the active item', function () {
|
||||
const item = document.createElement('div')
|
||||
const paneBelow = startingPane.splitDown()
|
||||
expect(paneBelow.getItems().length).toEqual(0)
|
||||
|
||||
startingPane.activate()
|
||||
startingPane.activateItem(item)
|
||||
workspaceElement.focusPaneViewAbove()
|
||||
workspaceElement.moveActiveItemToNearestPaneInDirection('below', {keepOriginal: true})
|
||||
expect(workspace.paneForItem(item)).toBe(startingPane)
|
||||
expect(paneBelow.getItems().length).toEqual(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user