mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Move pane focus handling tests to pane-element-spec
This commit is contained in:
parent
b053e95aa7
commit
e1b8680e1c
@ -142,3 +142,23 @@ describe "PaneElement", ->
|
||||
expect(item2.element.parentElement).toBe paneElement.itemViews
|
||||
pane.destroyItem(item2)
|
||||
expect(item2.element.parentElement).toBeNull()
|
||||
|
||||
describe "when the pane element is focused", ->
|
||||
it "transfers focus to the active view", ->
|
||||
item = document.createElement('div')
|
||||
item.tabIndex = -1
|
||||
pane.activateItem(item)
|
||||
jasmine.attachToDOM(paneElement)
|
||||
|
||||
expect(document.activeElement).toBe document.body
|
||||
paneElement.focus()
|
||||
expect(document.activeElement).toBe item
|
||||
|
||||
it "makes the pane active", ->
|
||||
pane.splitRight()
|
||||
expect(pane.isActive()).toBe false
|
||||
|
||||
jasmine.attachToDOM(paneElement)
|
||||
paneElement.focus()
|
||||
|
||||
expect(pane.isActive()).toBe true
|
||||
|
@ -46,22 +46,6 @@ describe "PaneView", ->
|
||||
deserializerDisposable.dispose()
|
||||
jasmine.restoreDeprecationsSnapshot()
|
||||
|
||||
describe "when the pane is focused", ->
|
||||
beforeEach ->
|
||||
container.attachToDom()
|
||||
|
||||
it "transfers focus to the active view", ->
|
||||
focusHandler = jasmine.createSpy("focusHandler")
|
||||
pane.getActiveItem().on 'focus', focusHandler
|
||||
pane.focus()
|
||||
expect(focusHandler).toHaveBeenCalled()
|
||||
|
||||
it "makes the pane active", ->
|
||||
paneModel.splitRight(items: [pane.copyActiveItem()])
|
||||
expect(paneModel.isActive()).toBe false
|
||||
pane.focus()
|
||||
expect(paneModel.isActive()).toBe true
|
||||
|
||||
describe "when a pane is split", ->
|
||||
it "builds the appropriateatom-pane-axis.horizontal and pane-column views", ->
|
||||
pane1 = pane
|
||||
|
Loading…
Reference in New Issue
Block a user