From 281a28bb0e451ad73d35da1b6aa584dd8595ba2d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 20 Feb 2013 16:42:16 -0700 Subject: [PATCH] Add spec for pane focusing the its current item view when it's focused --- spec/app/pane-spec.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/app/pane-spec.coffee b/spec/app/pane-spec.coffee index 2ada044da..d856b14df 100644 --- a/spec/app/pane-spec.coffee +++ b/spec/app/pane-spec.coffee @@ -102,6 +102,13 @@ describe "Pane", -> expect(editSession1.destroyed).toBeTruthy() expect(editSession2.destroyed).toBeTruthy() + describe ".focus()", -> + it "focuses the current item", -> + focusHandler = jasmine.createSpy("focusHandler") + pane.currentItem.on 'focus', focusHandler + pane.focus() + expect(focusHandler).toHaveBeenCalled() + describe ".itemForPath(path)", -> it "returns the item for which a call to .getPath() returns the given path", -> expect(pane.itemForPath(editSession1.getPath())).toBe editSession1