mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
🐛 Fix observation of moved items
`PaneContainer::onDidAddPaneItem` isn't triggered on moves.
This commit is contained in:
@@ -2314,6 +2314,23 @@ i = /test/; #FIXME\
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('when an item is moved', () => {
|
||||
it('stores the new location', () => {
|
||||
const ITEM_URI = 'atom://test'
|
||||
const item = {
|
||||
getURI: () => ITEM_URI,
|
||||
getDefaultLocation: jasmine.createSpy().andReturn('left'),
|
||||
getElement: () => document.createElement('div')
|
||||
}
|
||||
const centerPane = workspace.getActivePane()
|
||||
centerPane.addItem(item)
|
||||
const dockPane = atom.workspace.getRightDock().getActivePane()
|
||||
spyOn(workspace.itemLocationStore, 'save')
|
||||
centerPane.moveItemToPane(item, dockPane)
|
||||
expect(workspace.itemLocationStore.save).toHaveBeenCalledWith(ITEM_URI, 'right')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const escapeStringRegex = str => str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
|
||||
|
||||
Reference in New Issue
Block a user