Add test for Workspace::getVisiblePanes()

This commit is contained in:
Jason Rudolph
2017-06-05 17:29:46 -04:00
parent cd24e820f5
commit 110bd6a16e

View File

@@ -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