2014-11-25 23:55:50 +03:00
|
|
|
{$, $$, View} = require '../src/space-pen-extensions'
|
2013-10-03 01:25:32 +04:00
|
|
|
Q = require 'q'
|
2013-06-13 02:26:09 +04:00
|
|
|
path = require 'path'
|
2013-10-21 17:20:19 +04:00
|
|
|
temp = require 'temp'
|
2014-09-23 01:35:13 +04:00
|
|
|
TextEditorView = require '../src/text-editor-view'
|
2014-01-14 00:29:00 +04:00
|
|
|
PaneView = require '../src/pane-view'
|
2014-01-14 22:36:51 +04:00
|
|
|
Workspace = require '../src/workspace'
|
2012-08-28 02:36:36 +04:00
|
|
|
|
2013-11-26 22:11:31 +04:00
|
|
|
describe "WorkspaceView", ->
|
2013-02-20 04:18:25 +04:00
|
|
|
pathToOpen = null
|
2012-08-28 02:36:36 +04:00
|
|
|
|
|
|
|
beforeEach ->
|
2014-11-26 00:51:56 +03:00
|
|
|
jasmine.snapshotDeprecations()
|
|
|
|
|
2014-10-01 20:37:27 +04:00
|
|
|
atom.project.setPaths([atom.project.resolve('dir')])
|
2013-11-21 03:35:49 +04:00
|
|
|
pathToOpen = atom.project.resolve('a')
|
2014-01-14 22:36:51 +04:00
|
|
|
atom.workspace = new Workspace
|
2014-10-28 03:15:45 +03:00
|
|
|
atom.workspaceView = atom.views.getView(atom.workspace).__spacePenView
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.enableKeymap()
|
|
|
|
atom.workspaceView.focus()
|
2012-08-28 02:36:36 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
waitsForPromise ->
|
|
|
|
atom.workspace.open(pathToOpen)
|
|
|
|
|
2014-11-26 00:51:56 +03:00
|
|
|
afterEach ->
|
|
|
|
jasmine.restoreDeprecationsSnapshot()
|
|
|
|
|
2013-03-07 04:05:26 +04:00
|
|
|
describe "@deserialize()", ->
|
2013-01-18 04:30:09 +04:00
|
|
|
viewState = null
|
2012-08-28 02:36:36 +04:00
|
|
|
|
2013-12-07 00:38:46 +04:00
|
|
|
simulateReload = ->
|
2014-01-14 22:36:51 +04:00
|
|
|
workspaceState = atom.workspace.serialize()
|
2014-01-04 03:23:23 +04:00
|
|
|
projectState = atom.project.serialize()
|
2013-12-13 04:36:34 +04:00
|
|
|
atom.workspaceView.remove()
|
2014-01-04 03:23:23 +04:00
|
|
|
atom.project = atom.deserializers.deserialize(projectState)
|
2014-01-14 22:36:51 +04:00
|
|
|
atom.workspace = Workspace.deserialize(workspaceState)
|
2014-10-28 03:15:45 +03:00
|
|
|
atom.workspaceView = atom.views.getView(atom.workspace).__spacePenView
|
2013-12-13 04:36:34 +04:00
|
|
|
atom.workspaceView.attachToDom()
|
2013-07-21 08:40:40 +04:00
|
|
|
|
2013-11-26 22:11:31 +04:00
|
|
|
describe "when the serialized WorkspaceView has an unsaved buffer", ->
|
2013-02-20 04:18:25 +04:00
|
|
|
it "constructs the view with the same panes", ->
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.attachToDom()
|
2013-03-07 04:05:26 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
waitsForPromise ->
|
|
|
|
atom.workspace.open()
|
|
|
|
|
|
|
|
runs ->
|
|
|
|
editorView1 = atom.workspaceView.getActiveView()
|
|
|
|
buffer = editorView1.getEditor().getBuffer()
|
2014-09-11 04:41:38 +04:00
|
|
|
editorView1.getPaneView().getModel().splitRight(copyActiveItem: true)
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(atom.workspaceView.getActivePaneView()).toBe atom.workspaceView.getPaneViews()[1]
|
2013-02-21 03:43:29 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
simulateReload()
|
2013-02-21 03:43:29 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(atom.workspaceView.getEditorViews().length).toBe 2
|
|
|
|
expect(atom.workspaceView.getActivePaneView()).toBe atom.workspaceView.getPaneViews()[1]
|
2014-10-14 04:48:06 +04:00
|
|
|
expect(document.title).toBe "untitled - #{atom.project.getPaths()[0]} - Atom"
|
2013-01-18 04:30:09 +04:00
|
|
|
|
2013-06-21 02:57:34 +04:00
|
|
|
describe "when there are open editors", ->
|
|
|
|
it "constructs the view with the same panes", ->
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.attachToDom()
|
2014-04-18 20:18:13 +04:00
|
|
|
pane1 = atom.workspaceView.getActivePaneView()
|
2013-06-21 02:57:34 +04:00
|
|
|
pane2 = pane1.splitRight()
|
|
|
|
pane3 = pane2.splitRight()
|
2014-04-30 03:59:15 +04:00
|
|
|
pane4 = null
|
2013-06-21 02:57:34 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
waitsForPromise ->
|
2014-04-24 03:36:44 +04:00
|
|
|
atom.workspace.open('b').then (editor) ->
|
2014-09-20 02:30:37 +04:00
|
|
|
pane2.activateItem(editor.copy())
|
2014-04-23 03:51:50 +04:00
|
|
|
|
|
|
|
waitsForPromise ->
|
2014-04-24 03:36:44 +04:00
|
|
|
atom.workspace.open('../sample.js').then (editor) ->
|
2014-04-23 03:51:50 +04:00
|
|
|
pane3.activateItem(editor)
|
|
|
|
|
|
|
|
runs ->
|
|
|
|
pane3.activeItem.setCursorScreenPosition([2, 4])
|
2014-04-30 03:59:15 +04:00
|
|
|
pane4 = pane2.splitDown()
|
2014-04-23 03:51:50 +04:00
|
|
|
|
|
|
|
waitsForPromise ->
|
2014-04-24 03:36:44 +04:00
|
|
|
atom.workspace.open('../sample.txt').then (editor) ->
|
2014-04-23 03:51:50 +04:00
|
|
|
pane4.activateItem(editor)
|
|
|
|
|
|
|
|
runs ->
|
|
|
|
pane4.activeItem.setCursorScreenPosition([0, 2])
|
|
|
|
pane2.focus()
|
2013-06-21 02:57:34 +04:00
|
|
|
|
2014-04-23 03:51:50 +04:00
|
|
|
simulateReload()
|
|
|
|
|
|
|
|
expect(atom.workspaceView.getEditorViews().length).toBe 4
|
2014-10-09 01:11:57 +04:00
|
|
|
editorView1 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane atom-text-editor:eq(0)').view()
|
|
|
|
editorView3 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane atom-text-editor:eq(1)').view()
|
|
|
|
editorView2 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(0)').view()
|
|
|
|
editorView4 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(1)').view()
|
2014-04-23 03:51:50 +04:00
|
|
|
|
|
|
|
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
|
|
|
|
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
|
|
|
|
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
|
|
|
|
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
|
|
|
|
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
|
|
|
|
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
|
|
|
|
|
|
|
|
# ensure adjust pane dimensions is called
|
|
|
|
expect(editorView1.width()).toBeGreaterThan 0
|
|
|
|
expect(editorView2.width()).toBeGreaterThan 0
|
|
|
|
expect(editorView3.width()).toBeGreaterThan 0
|
|
|
|
expect(editorView4.width()).toBeGreaterThan 0
|
|
|
|
|
|
|
|
# ensure correct editorView is focused again
|
|
|
|
expect(editorView2).toHaveFocus()
|
|
|
|
expect(editorView1).not.toHaveFocus()
|
|
|
|
expect(editorView3).not.toHaveFocus()
|
|
|
|
expect(editorView4).not.toHaveFocus()
|
2013-06-21 02:57:34 +04:00
|
|
|
|
2014-10-14 04:48:06 +04:00
|
|
|
expect(document.title).toBe "#{path.basename(editorView2.getEditor().getPath())} - #{atom.project.getPaths()[0]} - Atom"
|
2013-06-21 02:57:34 +04:00
|
|
|
|
|
|
|
describe "where there are no open editors", ->
|
|
|
|
it "constructs the view with no open editors", ->
|
2014-04-18 20:18:13 +04:00
|
|
|
atom.workspaceView.getActivePaneView().remove()
|
2013-11-27 01:13:58 +04:00
|
|
|
expect(atom.workspaceView.getEditorViews().length).toBe 0
|
2013-12-07 00:38:46 +04:00
|
|
|
simulateReload()
|
2013-11-27 01:13:58 +04:00
|
|
|
expect(atom.workspaceView.getEditorViews().length).toBe 0
|
2013-01-11 04:24:36 +04:00
|
|
|
|
2012-08-28 02:36:36 +04:00
|
|
|
describe "focus", ->
|
2013-10-16 21:16:23 +04:00
|
|
|
beforeEach ->
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.attachToDom()
|
2013-10-16 21:16:23 +04:00
|
|
|
|
2014-01-15 22:25:53 +04:00
|
|
|
it "hands off focus to the active pane", ->
|
2014-04-18 20:18:13 +04:00
|
|
|
activePane = atom.workspaceView.getActivePaneView()
|
2014-01-15 22:25:53 +04:00
|
|
|
$('body').focus()
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(activePane).not.toHaveFocus()
|
2014-01-15 22:25:53 +04:00
|
|
|
atom.workspaceView.focus()
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(activePane).toHaveFocus()
|
2012-08-28 02:36:36 +04:00
|
|
|
|
|
|
|
describe "keymap wiring", ->
|
2013-11-26 22:11:31 +04:00
|
|
|
describe "when a keydown event is triggered in the WorkspaceView", ->
|
2012-08-28 02:36:36 +04:00
|
|
|
it "triggers matching keybindings for that event", ->
|
2014-10-07 02:35:00 +04:00
|
|
|
commandHandler = jasmine.createSpy('commandHandler')
|
|
|
|
atom.workspaceView.on('foo-command', commandHandler)
|
|
|
|
atom.keymaps.add('name', '*': {'x': 'foo-command'})
|
2013-11-26 22:11:31 +04:00
|
|
|
event = keydownEvent 'x', target: atom.workspaceView[0]
|
2012-08-28 02:36:36 +04:00
|
|
|
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.trigger(event)
|
2012-08-28 02:36:36 +04:00
|
|
|
expect(commandHandler).toHaveBeenCalled()
|
|
|
|
|
2012-10-19 01:44:21 +04:00
|
|
|
describe "window:toggle-invisibles event", ->
|
|
|
|
it "shows/hides invisibles in all open and future editors", ->
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.height(200)
|
|
|
|
atom.workspaceView.attachToDom()
|
2014-01-11 03:30:11 +04:00
|
|
|
rightEditorView = atom.workspaceView.getActiveView()
|
2014-08-13 00:19:04 +04:00
|
|
|
rightEditorView.getEditor().setText("\t \n")
|
2014-09-11 04:41:38 +04:00
|
|
|
rightEditorView.getPaneView().getModel().splitLeft(copyActiveItem: true)
|
|
|
|
leftEditorView = atom.workspaceView.getActiveView()
|
2014-01-11 03:30:11 +04:00
|
|
|
expect(rightEditorView.find(".line:first").text()).toBe " "
|
|
|
|
expect(leftEditorView.find(".line:first").text()).toBe " "
|
2012-10-19 01:44:21 +04:00
|
|
|
|
2014-08-13 00:19:04 +04:00
|
|
|
{space, tab, eol} = atom.config.get('editor.invisibles')
|
2014-06-19 03:54:44 +04:00
|
|
|
withInvisiblesShowing = "#{tab} #{space}#{space}#{eol}"
|
2012-12-21 03:42:38 +04:00
|
|
|
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.trigger "window:toggle-invisibles"
|
2014-01-11 03:30:11 +04:00
|
|
|
expect(rightEditorView.find(".line:first").text()).toBe withInvisiblesShowing
|
|
|
|
expect(leftEditorView.find(".line:first").text()).toBe withInvisiblesShowing
|
2012-10-19 01:44:21 +04:00
|
|
|
|
2014-09-11 04:41:38 +04:00
|
|
|
leftEditorView.getPaneView().getModel().splitDown(copyActiveItem: true)
|
|
|
|
lowerLeftEditorView = atom.workspaceView.getActiveView()
|
2014-01-11 03:30:11 +04:00
|
|
|
expect(lowerLeftEditorView.find(".line:first").text()).toBe withInvisiblesShowing
|
2012-10-19 01:44:21 +04:00
|
|
|
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.trigger "window:toggle-invisibles"
|
2014-01-11 03:30:11 +04:00
|
|
|
expect(rightEditorView.find(".line:first").text()).toBe " "
|
|
|
|
expect(leftEditorView.find(".line:first").text()).toBe " "
|
2012-10-19 01:44:21 +04:00
|
|
|
|
2014-09-11 04:41:38 +04:00
|
|
|
rightEditorView.getPaneView().getModel().splitDown(copyActiveItem: true)
|
|
|
|
lowerRightEditorView = atom.workspaceView.getActiveView()
|
2014-01-11 03:30:11 +04:00
|
|
|
expect(lowerRightEditorView.find(".line:first").text()).toBe " "
|
2013-01-10 01:18:10 +04:00
|
|
|
|
2013-11-27 01:05:53 +04:00
|
|
|
describe ".eachEditorView(callback)", ->
|
2012-10-11 05:41:12 +04:00
|
|
|
beforeEach ->
|
2013-11-26 22:11:31 +04:00
|
|
|
atom.workspaceView.attachToDom()
|
2012-10-11 05:41:12 +04:00
|
|
|
|
|
|
|
it "invokes the callback for existing editor", ->
|
|
|
|
count = 0
|
|
|
|
callbackEditor = null
|
|
|
|
callback = (editor) ->
|
|
|
|
callbackEditor = editor
|
|
|
|
count++
|
2013-11-27 01:05:53 +04:00
|
|
|
atom.workspaceView.eachEditorView(callback)
|
2012-10-11 05:41:12 +04:00
|
|
|
expect(count).toBe 1
|
2013-11-26 22:11:31 +04:00
|
|
|
expect(callbackEditor).toBe atom.workspaceView.getActiveView()
|
2012-10-11 05:41:12 +04:00
|
|
|
|
|
|
|
it "invokes the callback for new editor", ->
|
|
|
|
count = 0
|
|
|
|
callbackEditor = null
|
|
|
|
callback = (editor) ->
|
|
|
|
callbackEditor = editor
|
|
|
|
count++
|
|
|
|
|
2013-11-27 01:05:53 +04:00
|
|
|
atom.workspaceView.eachEditorView(callback)
|
2012-10-11 05:41:12 +04:00
|
|
|
count = 0
|
|
|
|
callbackEditor = null
|
2014-09-11 04:41:38 +04:00
|
|
|
atom.workspaceView.getActiveView().getPaneView().getModel().splitRight(copyActiveItem: true)
|
2012-10-11 05:41:12 +04:00
|
|
|
expect(count).toBe 1
|
2013-11-26 22:11:31 +04:00
|
|
|
expect(callbackEditor).toBe atom.workspaceView.getActiveView()
|
2012-10-12 20:16:46 +04:00
|
|
|
|
2014-04-24 20:24:39 +04:00
|
|
|
it "does not invoke the callback for mini editors", ->
|
|
|
|
editorViewCreatedHandler = jasmine.createSpy('editorViewCreatedHandler')
|
|
|
|
atom.workspaceView.eachEditorView(editorViewCreatedHandler)
|
|
|
|
editorViewCreatedHandler.reset()
|
2014-09-23 01:35:13 +04:00
|
|
|
miniEditor = new TextEditorView(mini: true)
|
2014-04-24 20:24:39 +04:00
|
|
|
atom.workspaceView.append(miniEditor)
|
|
|
|
expect(editorViewCreatedHandler).not.toHaveBeenCalled()
|
|
|
|
|
2013-06-12 22:37:49 +04:00
|
|
|
it "returns a subscription that can be disabled", ->
|
|
|
|
count = 0
|
|
|
|
callback = (editor) -> count++
|
|
|
|
|
2013-11-27 01:05:53 +04:00
|
|
|
subscription = atom.workspaceView.eachEditorView(callback)
|
2013-06-12 22:37:49 +04:00
|
|
|
expect(count).toBe 1
|
2014-09-11 04:41:38 +04:00
|
|
|
atom.workspaceView.getActiveView().getPaneView().getModel().splitRight(copyActiveItem: true)
|
2013-06-12 22:37:49 +04:00
|
|
|
expect(count).toBe 2
|
|
|
|
subscription.off()
|
2014-09-11 04:41:38 +04:00
|
|
|
atom.workspaceView.getActiveView().getPaneView().getModel().splitRight(copyActiveItem: true)
|
2013-06-12 22:37:49 +04:00
|
|
|
expect(count).toBe 2
|
2013-12-11 05:19:44 +04:00
|
|
|
|
2013-12-13 05:30:22 +04:00
|
|
|
describe "core:close", ->
|
2014-01-15 22:25:53 +04:00
|
|
|
it "closes the active pane item until all that remains is a single empty pane", ->
|
2014-01-15 14:50:14 +04:00
|
|
|
atom.config.set('core.destroyEmptyPanes', true)
|
2014-04-23 03:47:17 +04:00
|
|
|
|
|
|
|
paneView1 = atom.workspaceView.getActivePaneView()
|
|
|
|
editorView = atom.workspaceView.getActiveView()
|
2014-09-11 04:41:38 +04:00
|
|
|
editorView.getPaneView().getModel().splitRight(copyActiveItem: true)
|
2014-04-23 03:47:17 +04:00
|
|
|
paneView2 = atom.workspaceView.getActivePaneView()
|
|
|
|
|
|
|
|
expect(paneView1).not.toBe paneView2
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(atom.workspaceView.getPaneViews()).toHaveLength 2
|
2014-04-23 03:47:17 +04:00
|
|
|
atom.workspaceView.trigger('core:close')
|
|
|
|
|
2014-04-18 20:18:13 +04:00
|
|
|
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 1
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
|
2013-12-13 05:30:22 +04:00
|
|
|
atom.workspaceView.trigger('core:close')
|
2014-04-23 03:47:17 +04:00
|
|
|
|
2014-04-18 20:18:13 +04:00
|
|
|
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 0
|
2014-04-23 03:51:50 +04:00
|
|
|
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
|
2014-03-04 09:33:28 +04:00
|
|
|
|
2014-03-04 21:50:45 +04:00
|
|
|
describe "the scrollbar visibility class", ->
|
2014-03-04 09:33:28 +04:00
|
|
|
it "has a class based on the style of the scrollbar", ->
|
|
|
|
scrollbarStyle = require 'scrollbar-style'
|
|
|
|
scrollbarStyle.emitValue 'legacy'
|
2014-03-04 21:50:45 +04:00
|
|
|
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-always'
|
2014-03-04 09:33:28 +04:00
|
|
|
scrollbarStyle.emitValue 'overlay'
|
2014-03-04 21:50:45 +04:00
|
|
|
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-when-scrolling'
|
2014-07-28 21:23:36 +04:00
|
|
|
|
|
|
|
describe "editor font styling", ->
|
2014-07-29 01:43:17 +04:00
|
|
|
[editorNode, editor] = []
|
2014-07-28 21:23:36 +04:00
|
|
|
|
|
|
|
beforeEach ->
|
|
|
|
atom.workspaceView.attachToDom()
|
2014-10-09 01:11:57 +04:00
|
|
|
editorNode = atom.workspaceView.find('atom-text-editor')[0]
|
|
|
|
editor = atom.workspaceView.find('atom-text-editor').view().getEditor()
|
2014-07-28 21:23:36 +04:00
|
|
|
|
|
|
|
it "updates the font-size based on the 'editor.fontSize' config value", ->
|
2014-07-29 01:43:17 +04:00
|
|
|
initialCharWidth = editor.getDefaultCharWidth()
|
2014-07-28 21:23:36 +04:00
|
|
|
expect(getComputedStyle(editorNode).fontSize).toBe atom.config.get('editor.fontSize') + 'px'
|
|
|
|
atom.config.set('editor.fontSize', atom.config.get('editor.fontSize') + 5)
|
|
|
|
expect(getComputedStyle(editorNode).fontSize).toBe atom.config.get('editor.fontSize') + 'px'
|
2014-07-29 01:43:17 +04:00
|
|
|
expect(editor.getDefaultCharWidth()).toBeGreaterThan initialCharWidth
|
2014-07-28 21:23:36 +04:00
|
|
|
|
|
|
|
it "updates the font-family based on the 'editor.fontFamily' config value", ->
|
2014-07-29 01:43:17 +04:00
|
|
|
initialCharWidth = editor.getDefaultCharWidth()
|
2014-07-28 21:23:36 +04:00
|
|
|
expect(getComputedStyle(editorNode).fontFamily).toBe atom.config.get('editor.fontFamily')
|
|
|
|
atom.config.set('editor.fontFamily', 'sans-serif')
|
|
|
|
expect(getComputedStyle(editorNode).fontFamily).toBe atom.config.get('editor.fontFamily')
|
2014-07-29 01:43:17 +04:00
|
|
|
expect(editor.getDefaultCharWidth()).not.toBe initialCharWidth
|
2014-07-28 21:23:36 +04:00
|
|
|
|
|
|
|
it "updates the line-height based on the 'editor.lineHeight' config value", ->
|
2014-07-29 01:43:17 +04:00
|
|
|
initialLineHeight = editor.getLineHeightInPixels()
|
|
|
|
atom.config.set('editor.lineHeight', '30px')
|
2014-07-28 21:23:36 +04:00
|
|
|
expect(getComputedStyle(editorNode).lineHeight).toBe atom.config.get('editor.lineHeight')
|
2014-07-29 01:43:17 +04:00
|
|
|
expect(editor.getLineHeightInPixels()).not.toBe initialLineHeight
|
2014-10-15 04:45:13 +04:00
|
|
|
|
2014-10-17 03:17:44 +04:00
|
|
|
describe 'panel containers', ->
|
2014-10-15 04:45:13 +04:00
|
|
|
workspaceElement = null
|
|
|
|
beforeEach ->
|
2014-10-28 03:15:45 +03:00
|
|
|
workspaceElement = atom.views.getView(atom.workspace)
|
2014-10-15 04:45:13 +04:00
|
|
|
|
2014-10-17 03:17:44 +04:00
|
|
|
it 'inserts panel container elements in the correct places in the DOM', ->
|
2014-11-18 03:07:53 +03:00
|
|
|
leftContainer = workspaceElement.querySelector('atom-panel-container.left')
|
|
|
|
rightContainer = workspaceElement.querySelector('atom-panel-container.right')
|
2014-10-17 03:17:44 +04:00
|
|
|
expect(leftContainer.nextSibling).toBe workspaceElement.verticalAxis
|
|
|
|
expect(rightContainer.previousSibling).toBe workspaceElement.verticalAxis
|
2014-10-15 04:45:13 +04:00
|
|
|
|
2014-11-18 03:07:53 +03:00
|
|
|
topContainer = workspaceElement.querySelector('atom-panel-container.top')
|
|
|
|
bottomContainer = workspaceElement.querySelector('atom-panel-container.bottom')
|
2014-10-17 03:17:44 +04:00
|
|
|
expect(topContainer.nextSibling).toBe workspaceElement.paneContainer
|
|
|
|
expect(bottomContainer.previousSibling).toBe workspaceElement.paneContainer
|
2014-11-04 22:43:51 +03:00
|
|
|
|
2014-11-18 03:07:53 +03:00
|
|
|
modalContainer = workspaceElement.querySelector('atom-panel-container.modal')
|
2014-11-04 22:43:51 +03:00
|
|
|
expect(modalContainer.parentNode).toBe workspaceElement
|