mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
✅ Add test for Workspace::getVisiblePanes()
This commit is contained in:
@@ -2584,6 +2584,46 @@ i = /test/; #FIXME\
|
||||
})
|
||||
})
|
||||
|
||||
describe('::getVisiblePanes', () => {
|
||||
it('returns all panes in visible pane containers', () => {
|
||||
const center = workspace.getCenter()
|
||||
const leftDock = workspace.getLeftDock()
|
||||
const rightDock = workspace.getRightDock()
|
||||
const bottomDock = workspace.getBottomDock()
|
||||
|
||||
const centerPane = center.getPanes()[0]
|
||||
const leftDockPane = leftDock.getPanes()[0]
|
||||
const rightDockPane = rightDock.getPanes()[0]
|
||||
const bottomDockPane = bottomDock.getPanes()[0]
|
||||
|
||||
leftDock.hide()
|
||||
rightDock.hide()
|
||||
bottomDock.hide()
|
||||
expect(workspace.getVisiblePanes()).toContain(centerPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(leftDockPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(rightDockPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(bottomDockPane)
|
||||
|
||||
leftDock.show()
|
||||
expect(workspace.getVisiblePanes()).toContain(centerPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(leftDockPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(rightDockPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(bottomDockPane)
|
||||
|
||||
rightDock.show()
|
||||
expect(workspace.getVisiblePanes()).toContain(centerPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(leftDockPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(rightDockPane)
|
||||
expect(workspace.getVisiblePanes()).not.toContain(bottomDockPane)
|
||||
|
||||
bottomDock.show()
|
||||
expect(workspace.getVisiblePanes()).toContain(centerPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(leftDockPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(rightDockPane)
|
||||
expect(workspace.getVisiblePanes()).toContain(bottomDockPane)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when the core.allowPendingPaneItems option is falsey', () => {
|
||||
it('does not open item with `pending: true` option as pending', () => {
|
||||
let pane = null
|
||||
|
||||
Reference in New Issue
Block a user