Move tests of adding/removing pane active class to pane-element-spec

This commit is contained in:
Nathan Sobo 2015-09-03 13:32:42 -06:00
parent fec21165d0
commit b053e95aa7
2 changed files with 11 additions and 15 deletions

View File

@ -8,6 +8,17 @@ describe "PaneElement", ->
pane = container.getRoot()
paneElement = atom.views.getView(pane)
describe "when the pane's active status changes", ->
it "adds or removes the .active class as appropriate", ->
pane2 = pane.splitRight()
expect(pane2.isActive()).toBe true
expect(paneElement.className).not.toMatch /active/
pane.activate()
expect(paneElement.className).toMatch /active/
pane2.activate()
expect(paneElement.className).not.toMatch /active/
describe "when the active item changes", ->
it "hides all item elements except the active one", ->
item1 = document.createElement('div')

View File

@ -46,21 +46,6 @@ describe "PaneView", ->
deserializerDisposable.dispose()
jasmine.restoreDeprecationsSnapshot()
describe "when the pane's active status changes", ->
[pane2, pane2Model] = []
beforeEach ->
pane2Model = paneModel.splitRight(items: [pane.copyActiveItem()])
pane2 = atom.views.getView(pane2Model).__spacePenView
expect(pane2Model.isActive()).toBe true
it "adds or removes the .active class as appropriate", ->
expect(pane).not.toHaveClass('active')
paneModel.activate()
expect(pane).toHaveClass('active')
pane2Model.activate()
expect(pane).not.toHaveClass('active')
describe "when the pane is focused", ->
beforeEach ->
container.attachToDom()