Move test of pane focus on attachment to pane-element-spec

This commit is contained in:
Nathan Sobo
2015-09-03 13:59:59 -06:00
parent f0fe2d8463
commit b405ad2f9b
2 changed files with 6 additions and 16 deletions

View File

@@ -162,3 +162,9 @@ describe "PaneElement", ->
paneElement.focus()
expect(pane.isActive()).toBe true
describe "when the pane element is attached", ->
it "focuses the pane element if isFocused() returns true on its model", ->
pane.focus()
jasmine.attachToDOM(paneElement)
expect(document.activeElement).toBe paneElement

View File

@@ -46,22 +46,6 @@ describe "PaneView", ->
deserializerDisposable.dispose()
jasmine.restoreDeprecationsSnapshot()
describe "serialization", ->
it "focuses the pane after attach only if had focus when serialized", ->
container.attachToDom()
pane.focus()
container2 = atom.views.getView(container.model.testSerialization()).__spacePenView
pane2 = container2.getRoot()
container2.attachToDom()
expect(pane2).toMatchSelector(':has(:focus)')
$(document.activeElement).blur()
container3 = atom.views.getView(container.model.testSerialization()).__spacePenView
pane3 = container3.getRoot()
container3.attachToDom()
expect(pane3).not.toMatchSelector(':has(:focus)')
describe "drag and drop", ->
buildDragEvent = (type, files) ->
dataTransfer =