Move ‘core:close’ specs in workspace-view-spec to workspace-spec

This commit is contained in:
Nathan Sobo
2015-09-03 10:17:24 -06:00
parent 7fc04501c9
commit 117d1507ab
2 changed files with 29 additions and 20 deletions

View File

@@ -1325,3 +1325,32 @@ describe "Workspace", ->
save = -> atom.workspace.saveActivePaneItem()
expect(save).toThrow()
describe "::destroyActivePaneItemOrEmptyPane", ->
beforeEach ->
waitsForPromise -> atom.workspace.open()
it "closes the active pane item until all that remains is a single empty pane", ->
atom.config.set('core.destroyEmptyPanes', false)
pane1 = atom.workspace.getActivePane()
pane2 = pane1.splitRight(copyActiveItem: true)
expect(atom.workspace.getPanes().length).toBe 2
expect(pane2.getItems().length).toBe 1
atom.workspace.destroyActivePaneItemOrEmptyPane()
expect(atom.workspace.getPanes().length).toBe 2
expect(pane2.getItems().length).toBe 0
atom.workspace.destroyActivePaneItemOrEmptyPane()
expect(atom.workspace.getPanes().length).toBe 1
expect(pane1.getItems().length).toBe 1
atom.workspace.destroyActivePaneItemOrEmptyPane()
expect(atom.workspace.getPanes().length).toBe 1
expect(pane1.getItems().length).toBe 0
atom.workspace.destroyActivePaneItemOrEmptyPane()
expect(atom.workspace.getPanes().length).toBe 1

View File

@@ -25,26 +25,6 @@ describe "WorkspaceView", ->
afterEach ->
jasmine.restoreDeprecationsSnapshot()
describe "core:close", ->
it "closes the active pane item until all that remains is a single empty pane", ->
atom.config.set('core.destroyEmptyPanes', true)
paneView1 = atom.workspaceView.getActivePaneView()
editorView = atom.workspaceView.getActiveView()
editorView.getPaneView().getModel().splitRight(copyActiveItem: true)
paneView2 = atom.workspaceView.getActivePaneView()
expect(paneView1).not.toBe paneView2
expect(atom.workspaceView.getPaneViews()).toHaveLength 2
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 1
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 0
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
describe "the scrollbar visibility class", ->
it "has a class based on the style of the scrollbar", ->
style = 'legacy'