From e40ef030089f7500ff7a2fcfcf56c2d0593ff93f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 5 Apr 2017 15:31:21 -0700 Subject: [PATCH] Fix Workspace.open test for activating existing items in docks --- spec/workspace-spec.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/workspace-spec.js b/spec/workspace-spec.js index effab6076..f00a2c12f 100644 --- a/spec/workspace-spec.js +++ b/spec/workspace-spec.js @@ -379,7 +379,7 @@ describe('Workspace', () => { }) }) - it('activates the dock with the matching item', () => { + it('activates the pane in the dock with the matching item', () => { const dock = atom.workspace.getRightDock() const ITEM_URI = 'atom://test' const item = { @@ -388,11 +388,9 @@ describe('Workspace', () => { getElement: () => document.createElement('div') } dock.getActivePane().addItem(item) - spyOn(dock, 'activate') + spyOn(dock.paneForItem(item), 'activate') waitsForPromise(() => atom.workspace.open(ITEM_URI, {searchAllPanes: true})) - runs(() => { - expect(dock.activate).toHaveBeenCalled() - }) + runs(() => expect(dock.paneForItem(item).activate).toHaveBeenCalled()) }) })