From 0cb00a8de8ef8ec7e063eae18409d754a90a5d08 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Tue, 14 Apr 2015 23:23:26 -0400 Subject: [PATCH] :white_check_mark: Add converse specs --- spec/pane-view-spec.coffee | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/pane-view-spec.coffee b/spec/pane-view-spec.coffee index 3ab43847d..114fbf2bf 100644 --- a/spec/pane-view-spec.coffee +++ b/spec/pane-view-spec.coffee @@ -119,13 +119,22 @@ describe "PaneView", -> expect(pane.itemViews.find('#view-2').length).toBe 1 describe "when the new activeItem implements ::getPath", -> - it "adds its file path to the active pane", -> + beforeEach -> paneModel.activateItem(editor1) + it "adds its file path to the active pane", -> expect(pane).toHaveAttr('data-active-path') it "adds its file name to the active pane", -> - paneModel.activateItem(editor1) expect(pane).toHaveAttr('data-active-name') + describe "when the new activeItem does not implement ::getPath", -> + beforeEach -> + paneModel.activateItem(editor1) + paneModel.activateItem(document.createElement('div')) + it "removes its file path from the active pane", -> + expect(pane).not.toHaveAttr('data-active-path') + it "removes its file name from the active pane", -> + expect(pane).not.toHaveAttr('data-active-name') + describe "when an item is destroyed", -> it "triggers the 'pane:item-removed' event with the item and its former index", -> itemRemovedHandler = jasmine.createSpy("itemRemovedHandler")