From 3020a61e344fde603dcc57bff2bbfcb3a7e24abc Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Fri, 19 May 2017 10:49:51 -0400 Subject: [PATCH] Test activating next/previous pane at the workspace level --- spec/workspace-spec.js | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/spec/workspace-spec.js b/spec/workspace-spec.js index 6dc9d025d..9eaa17bcd 100644 --- a/spec/workspace-spec.js +++ b/spec/workspace-spec.js @@ -2528,6 +2528,62 @@ i = /test/; #FIXME\ }) }) + describe('::activateNextPane', () => { + describe('when the active workspace pane is inside a dock', () => { + it('activates the next pane in the dock', () => { + const dock = atom.workspace.getLeftDock() + const dockPane1 = dock.getPanes()[0] + const dockPane2 = dockPane1.splitRight() + + dockPane2.focus() + expect(atom.workspace.getActivePane()).toBe(dockPane2) + atom.workspace.activateNextPane() + expect(atom.workspace.getActivePane()).toBe(dockPane1) + }) + }) + + describe('when the active workspace pane is inside the workspace center', () => { + it('activates the next pane in the workspace center', () => { + const center = atom.workspace.getCenter() + const centerPane1 = center.getPanes()[0] + const centerPane2 = centerPane1.splitRight() + + centerPane2.focus() + expect(atom.workspace.getActivePane()).toBe(centerPane2) + atom.workspace.activateNextPane() + expect(atom.workspace.getActivePane()).toBe(centerPane1) + }) + }) + }) + + describe('::activatePreviousPane', () => { + describe('when the active workspace pane is inside a dock', () => { + it('activates the previous pane in the dock', () => { + const dock = atom.workspace.getLeftDock() + const dockPane1 = dock.getPanes()[0] + const dockPane2 = dockPane1.splitRight() + + dockPane1.focus() + expect(atom.workspace.getActivePane()).toBe(dockPane1) + atom.workspace.activatePreviousPane() + expect(atom.workspace.getActivePane()).toBe(dockPane2) + }) + }) + + describe('when the active workspace pane is inside the workspace center', () => { + it('activates the previous pane in the workspace center', () => { + const center = atom.workspace.getCenter() + const centerPane1 = center.getPanes()[0] + const centerPane2 = centerPane1.splitRight() + + centerPane1.focus() + expect(atom.workspace.getActivePane()).toBe(centerPane1) + atom.workspace.activatePreviousPane() + expect(atom.workspace.getActivePane()).toBe(centerPane2) + }) + }) + }) + describe('when the core.allowPendingPaneItems option is falsey', () => { it('does not open item with `pending: true` option as pending', () => { let pane = null