2013-10-21 17:20:19 +04:00
|
|
|
path = require 'path'
|
|
|
|
temp = require 'temp'
|
2014-09-18 23:42:13 +04:00
|
|
|
PaneContainer = require '../src/pane-container'
|
2014-01-14 00:39:02 +04:00
|
|
|
PaneContainerView = require '../src/pane-container-view'
|
2014-01-14 00:29:00 +04:00
|
|
|
PaneView = require '../src/pane-view'
|
2014-11-26 01:29:46 +03:00
|
|
|
{Disposable} = require 'event-kit'
|
2014-11-25 23:55:50 +03:00
|
|
|
{$, View, $$} = require '../src/space-pen-extensions'
|
2013-02-21 09:28:43 +04:00
|
|
|
|
2014-01-14 00:39:02 +04:00
|
|
|
describe "PaneContainerView", ->
|
2014-09-30 22:54:50 +04:00
|
|
|
[TestView, container, pane1, pane2, pane3, deserializerDisposable] = []
|
2013-02-21 09:28:43 +04:00
|
|
|
|
|
|
|
beforeEach ->
|
|
|
|
class TestView extends View
|
2014-09-30 22:54:50 +04:00
|
|
|
deserializerDisposable = atom.deserializers.add(this)
|
2013-03-06 23:57:17 +04:00
|
|
|
@deserialize: ({name}) -> new TestView(name)
|
2013-02-21 09:28:43 +04:00
|
|
|
@content: -> @div tabindex: -1
|
2013-03-06 23:57:17 +04:00
|
|
|
initialize: (@name) -> @text(@name)
|
2015-04-07 06:45:02 +03:00
|
|
|
serialize: -> {deserializer: 'TestView', @name}
|
2015-01-13 05:06:31 +03:00
|
|
|
getURI: -> path.join(temp.dir, @name)
|
2013-03-02 03:44:27 +04:00
|
|
|
save: -> @saved = true
|
2014-01-08 04:23:29 +04:00
|
|
|
isEqual: (other) -> @name is other?.name
|
2014-11-26 01:29:46 +03:00
|
|
|
onDidChangeTitle: -> new Disposable(->)
|
|
|
|
onDidChangeModified: -> new Disposable(->)
|
2013-02-21 09:28:43 +04:00
|
|
|
|
2014-10-28 03:15:45 +03:00
|
|
|
container = atom.views.getView(atom.workspace.paneContainer).__spacePenView
|
2014-01-15 22:25:53 +04:00
|
|
|
pane1 = container.getRoot()
|
|
|
|
pane1.activateItem(new TestView('1'))
|
2013-02-21 09:28:43 +04:00
|
|
|
pane2 = pane1.splitRight(new TestView('2'))
|
|
|
|
pane3 = pane2.splitDown(new TestView('3'))
|
|
|
|
|
|
|
|
afterEach ->
|
2014-09-30 22:54:50 +04:00
|
|
|
deserializerDisposable.dispose()
|
2013-02-21 09:28:43 +04:00
|
|
|
|
2014-04-18 20:18:13 +04:00
|
|
|
describe ".getActivePaneView()", ->
|
2013-02-21 22:56:47 +04:00
|
|
|
it "returns the most-recently focused pane", ->
|
|
|
|
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
|
|
|
|
focusStealer.attachToDom()
|
|
|
|
container.attachToDom()
|
|
|
|
|
|
|
|
pane2.focus()
|
|
|
|
expect(container.getFocusedPane()).toBe pane2
|
2014-04-18 20:18:13 +04:00
|
|
|
expect(container.getActivePaneView()).toBe pane2
|
2013-02-21 22:56:47 +04:00
|
|
|
|
|
|
|
focusStealer.focus()
|
|
|
|
expect(container.getFocusedPane()).toBeUndefined()
|
2014-04-18 20:18:13 +04:00
|
|
|
expect(container.getActivePaneView()).toBe pane2
|
2013-02-21 22:56:47 +04:00
|
|
|
|
|
|
|
pane3.focus()
|
|
|
|
expect(container.getFocusedPane()).toBe pane3
|
2014-04-18 20:18:13 +04:00
|
|
|
expect(container.getActivePaneView()).toBe pane3
|
2013-02-21 22:56:47 +04:00
|
|
|
|
2014-02-19 03:05:29 +04:00
|
|
|
describe ".eachPaneView(callback)", ->
|
2013-02-26 02:27:09 +04:00
|
|
|
it "runs the callback with all current and future panes until the subscription is cancelled", ->
|
|
|
|
panes = []
|
2014-02-19 03:05:29 +04:00
|
|
|
subscription = container.eachPaneView (pane) -> panes.push(pane)
|
2013-02-26 02:27:09 +04:00
|
|
|
expect(panes).toEqual [pane1, pane2, pane3]
|
|
|
|
|
|
|
|
panes = []
|
2013-10-30 22:01:43 +04:00
|
|
|
pane4 = pane3.splitRight(pane3.copyActiveItem())
|
2013-02-26 02:27:09 +04:00
|
|
|
expect(panes).toEqual [pane4]
|
|
|
|
|
|
|
|
panes = []
|
2013-11-21 07:07:56 +04:00
|
|
|
subscription.off()
|
2013-02-26 02:27:09 +04:00
|
|
|
pane4.splitDown()
|
|
|
|
expect(panes).toEqual []
|
|
|
|
|
2013-03-02 03:44:27 +04:00
|
|
|
describe ".saveAll()", ->
|
|
|
|
it "saves all open pane items", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(new TestView('4'))
|
2013-03-02 03:44:27 +04:00
|
|
|
|
|
|
|
container.saveAll()
|
|
|
|
|
2014-02-19 03:13:27 +04:00
|
|
|
for pane in container.getPaneViews()
|
2013-03-02 03:44:27 +04:00
|
|
|
for item in pane.getItems()
|
|
|
|
expect(item.saved).toBeTruthy()
|
|
|
|
|
2013-02-21 09:28:43 +04:00
|
|
|
describe "serialization", ->
|
|
|
|
it "can be serialized and deserialized, and correctly adjusts dimensions of deserialized panes after attach", ->
|
2014-10-28 03:15:45 +03:00
|
|
|
newContainer = atom.views.getView(container.model.testSerialization()).__spacePenView
|
2014-10-08 22:32:58 +04:00
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > :contains(1)')).toExist()
|
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > :contains(2)')).toExist()
|
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > :contains(3)')).toExist()
|
2013-02-21 09:28:43 +04:00
|
|
|
|
|
|
|
newContainer.height(200).width(300).attachToDom()
|
2014-10-08 22:32:58 +04:00
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > :contains(1)').width()).toBe 150
|
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > :contains(2)').height()).toBe 100
|
2013-03-08 23:45:20 +04:00
|
|
|
|
2014-01-15 15:22:16 +04:00
|
|
|
describe "if there are empty panes after deserialization", ->
|
|
|
|
beforeEach ->
|
|
|
|
# only deserialize pane 1's view successfully
|
|
|
|
TestView.deserialize = ({name}) -> new TestView(name) if name is '1'
|
|
|
|
|
|
|
|
describe "if the 'core.destroyEmptyPanes' config option is false (the default)", ->
|
|
|
|
it "leaves the empty panes intact", ->
|
2014-10-28 03:15:45 +03:00
|
|
|
newContainer = atom.views.getView(container.model.testSerialization()).__spacePenView
|
2014-10-08 22:32:58 +04:00
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > :contains(1)')).toExist()
|
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane').length).toBe 2
|
2014-01-15 15:22:16 +04:00
|
|
|
|
|
|
|
describe "if the 'core.destroyEmptyPanes' config option is true", ->
|
|
|
|
it "removes empty panes on deserialization", ->
|
|
|
|
atom.config.set('core.destroyEmptyPanes', true)
|
2014-10-28 03:15:45 +03:00
|
|
|
newContainer = atom.views.getView(container.model.testSerialization()).__spacePenView
|
2014-10-08 22:32:58 +04:00
|
|
|
expect(newContainer.find('atom-pane-axis.horizontal, atom-pane-axis.vertical')).not.toExist()
|
2014-01-15 15:22:16 +04:00
|
|
|
expect(newContainer.find('> :contains(1)')).toExist()
|
2013-08-30 02:41:23 +04:00
|
|
|
|
2013-08-30 03:03:51 +04:00
|
|
|
describe "pane-container:active-pane-item-changed", ->
|
2013-08-30 02:41:23 +04:00
|
|
|
[pane1, item1a, item1b, item2a, item2b, item3a, container, activeItemChangedHandler] = []
|
|
|
|
beforeEach ->
|
|
|
|
item1a = new TestView('1a')
|
|
|
|
item1b = new TestView('1b')
|
|
|
|
item2a = new TestView('2a')
|
|
|
|
item2b = new TestView('2b')
|
|
|
|
item3a = new TestView('3a')
|
|
|
|
|
2014-10-28 03:15:45 +03:00
|
|
|
container = atom.views.getView(new PaneContainer).__spacePenView
|
2014-01-15 22:25:53 +04:00
|
|
|
pane1 = container.getRoot()
|
|
|
|
pane1.activateItem(item1a)
|
2013-08-30 02:41:23 +04:00
|
|
|
container.attachToDom()
|
|
|
|
|
|
|
|
activeItemChangedHandler = jasmine.createSpy("activeItemChangedHandler")
|
2013-08-30 03:03:51 +04:00
|
|
|
container.on 'pane-container:active-pane-item-changed', activeItemChangedHandler
|
2013-08-30 02:41:23 +04:00
|
|
|
|
|
|
|
describe "when there is one pane", ->
|
|
|
|
it "is triggered when a new pane item is added", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1b
|
|
|
|
|
|
|
|
it "is not triggered when the active pane item is shown again", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1a)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
|
|
|
|
|
|
|
it "is triggered when switching to an existing pane item", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1a)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is triggered when the active pane item is destroyed", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
pane1.destroyItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is not triggered when an inactive pane item is destroyed", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
pane1.destroyItem(item1a)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is triggered when all pane items are destroyed", ->
|
|
|
|
pane1.destroyItem(item1a)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
|
|
|
|
|
|
|
|
describe "when there are two panes", ->
|
|
|
|
[pane2] = []
|
|
|
|
|
|
|
|
beforeEach ->
|
|
|
|
pane2 = pane1.splitLeft(item2a)
|
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
|
|
|
it "is triggered when a new pane item is added to the active pane", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane2.activateItem(item2b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2b
|
|
|
|
|
|
|
|
it "is not triggered when a new pane item is added to an inactive pane", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is triggered when the active pane's active item is destroyed", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane2.activateItem(item2b)
|
2013-08-30 02:41:23 +04:00
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
pane2.destroyItem(item2b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2a
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is not triggered when an inactive pane's active item is destroyed", ->
|
2014-01-13 04:40:57 +04:00
|
|
|
pane1.activateItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
pane1.destroyItem(item1b)
|
2013-08-30 02:41:23 +04:00
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is triggered when the active pane is destroyed", ->
|
2013-08-30 02:41:23 +04:00
|
|
|
pane2.remove()
|
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is not triggered when an inactive pane is destroyed", ->
|
2013-08-30 02:41:23 +04:00
|
|
|
pane1.remove()
|
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
|
|
|
|
2013-08-30 21:41:06 +04:00
|
|
|
it "is triggered when the active pane is changed", ->
|
2014-01-12 07:48:01 +04:00
|
|
|
pane1.activate()
|
2013-08-30 21:41:06 +04:00
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
|
|
|
|
|
2013-08-30 02:41:23 +04:00
|
|
|
describe "when there are multiple panes", ->
|
|
|
|
beforeEach ->
|
|
|
|
pane2 = pane1.splitRight(item2a)
|
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
|
|
|
it "is triggered when a new pane is added", ->
|
|
|
|
pane2.splitDown(item3a)
|
|
|
|
expect(activeItemChangedHandler.callCount).toBe 1
|
|
|
|
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item3a
|
|
|
|
|
2014-01-13 04:25:51 +04:00
|
|
|
it "is not triggered when an inactive pane is destroyed", ->
|
2013-08-30 02:41:23 +04:00
|
|
|
pane3 = pane2.splitDown(item3a)
|
|
|
|
activeItemChangedHandler.reset()
|
|
|
|
|
|
|
|
pane1.remove()
|
|
|
|
pane2.remove()
|
|
|
|
expect(activeItemChangedHandler).not.toHaveBeenCalled()
|
2014-01-27 02:25:59 +04:00
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusNextPaneView()", ->
|
2014-01-27 02:27:41 +04:00
|
|
|
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
|
|
|
|
container.attachToDom()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusNextPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane1.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusNextPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane2.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusNextPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane3.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusNextPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane1.activeItem).toMatchSelector ':focus'
|
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusPreviousPaneView()", ->
|
2014-01-27 02:27:41 +04:00
|
|
|
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
|
|
|
|
container.attachToDom()
|
2014-02-19 03:13:27 +04:00
|
|
|
container.getPaneViews()[0].focus() # activate first pane
|
2014-01-27 02:27:41 +04:00
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPreviousPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane3.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPreviousPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane2.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPreviousPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane1.activeItem).toMatchSelector ':focus'
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPreviousPaneView()
|
2014-01-27 02:27:41 +04:00
|
|
|
expect(pane3.activeItem).toMatchSelector ':focus'
|
|
|
|
|
2014-01-27 02:25:59 +04:00
|
|
|
describe "changing focus directionally between panes", ->
|
|
|
|
[pane1, pane2, pane3, pane4, pane5, pane6, pane7, pane8, pane9] = []
|
|
|
|
|
|
|
|
beforeEach ->
|
|
|
|
# Set up a grid of 9 panes, in the following arrangement, where the
|
|
|
|
# numbers correspond to the variable names below.
|
|
|
|
#
|
|
|
|
# -------
|
|
|
|
# |1|2|3|
|
|
|
|
# -------
|
|
|
|
# |4|5|6|
|
|
|
|
# -------
|
|
|
|
# |7|8|9|
|
|
|
|
# -------
|
|
|
|
|
2014-10-28 03:15:45 +03:00
|
|
|
container = atom.views.getView(new PaneContainer).__spacePenView
|
2014-01-27 02:25:59 +04:00
|
|
|
pane1 = container.getRoot()
|
|
|
|
pane1.activateItem(new TestView('1'))
|
|
|
|
pane4 = pane1.splitDown(new TestView('4'))
|
|
|
|
pane7 = pane4.splitDown(new TestView('7'))
|
|
|
|
|
|
|
|
pane2 = pane1.splitRight(new TestView('2'))
|
|
|
|
pane3 = pane2.splitRight(new TestView('3'))
|
|
|
|
|
|
|
|
pane5 = pane4.splitRight(new TestView('5'))
|
|
|
|
pane6 = pane5.splitRight(new TestView('6'))
|
|
|
|
|
|
|
|
pane8 = pane7.splitRight(new TestView('8'))
|
|
|
|
pane9 = pane8.splitRight(new TestView('9'))
|
|
|
|
|
|
|
|
container.height(400)
|
|
|
|
container.width(400)
|
|
|
|
container.attachToDom()
|
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusPaneViewAbove()", ->
|
2014-01-27 02:25:59 +04:00
|
|
|
describe "when there are multiple rows above the focused pane", ->
|
|
|
|
it "focuses up to the adjacent row", ->
|
|
|
|
pane8.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewAbove()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane5.activeItem).toMatchSelector ':focus'
|
|
|
|
|
|
|
|
describe "when there are no rows above the focused pane", ->
|
|
|
|
it "keeps the current pane focused", ->
|
|
|
|
pane2.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewAbove()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane2.activeItem).toMatchSelector ':focus'
|
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusPaneViewBelow()", ->
|
2014-01-27 02:25:59 +04:00
|
|
|
describe "when there are multiple rows below the focused pane", ->
|
|
|
|
it "focuses down to the adjacent row", ->
|
|
|
|
pane2.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewBelow()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane5.activeItem).toMatchSelector ':focus'
|
|
|
|
|
|
|
|
describe "when there are no rows below the focused pane", ->
|
|
|
|
it "keeps the current pane focused", ->
|
|
|
|
pane8.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewBelow()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane8.activeItem).toMatchSelector ':focus'
|
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusPaneViewOnLeft()", ->
|
2014-01-27 02:25:59 +04:00
|
|
|
describe "when there are multiple columns to the left of the focused pane", ->
|
|
|
|
it "focuses left to the adjacent column", ->
|
|
|
|
pane6.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewOnLeft()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane5.activeItem).toMatchSelector ':focus'
|
|
|
|
|
|
|
|
describe "when there are no columns to the left of the focused pane", ->
|
|
|
|
it "keeps the current pane focused", ->
|
|
|
|
pane4.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewOnLeft()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane4.activeItem).toMatchSelector ':focus'
|
|
|
|
|
2014-02-19 03:31:19 +04:00
|
|
|
describe ".focusPaneViewOnRight()", ->
|
2014-01-27 02:25:59 +04:00
|
|
|
describe "when there are multiple columns to the right of the focused pane", ->
|
|
|
|
it "focuses right to the adjacent column", ->
|
|
|
|
pane4.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewOnRight()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane5.activeItem).toMatchSelector ':focus'
|
|
|
|
|
|
|
|
describe "when there are no columns to the right of the focused pane", ->
|
|
|
|
it "keeps the current pane focused", ->
|
|
|
|
pane6.focus()
|
2014-02-19 03:31:19 +04:00
|
|
|
container.focusPaneViewOnRight()
|
2014-01-27 02:25:59 +04:00
|
|
|
expect(pane6.activeItem).toMatchSelector ':focus'
|