Add "location" param to open()

This commit is contained in:
Matthew Dapena-Tretter
2017-03-23 18:28:12 -07:00
parent d9e1fcc70b
commit 52606171bf
2 changed files with 16 additions and 13 deletions

View File

@@ -126,22 +126,21 @@ describe('Workspace', () => {
})
it('constructs the view with the same panes', () => {
const getRightDockActivePane = () => atom.workspace.getRightDock().getActivePane()
const pane1 = atom.workspace.getRightDock().getActivePane()
const pane2 = pane1.splitRight({copyActiveItem: true})
const pane3 = pane2.splitRight({copyActiveItem: true})
let pane4 = null
waitsForPromise(() =>
atom.workspace.open(null, {pane: getRightDockActivePane()}).then(editor => editor.setText('An untitled editor.'))
atom.workspace.open(null, {location: 'right'}).then(editor => editor.setText('An untitled editor.'))
)
waitsForPromise(() =>
atom.workspace.open('b', {pane: getRightDockActivePane()}).then(editor => pane2.activateItem(editor.copy()))
atom.workspace.open('b', {location: 'right'}).then(editor => pane2.activateItem(editor.copy()))
)
waitsForPromise(() =>
atom.workspace.open('../sample.js', {pane: getRightDockActivePane()}).then(editor => pane3.activateItem(editor))
atom.workspace.open('../sample.js', {location: 'right'}).then(editor => pane3.activateItem(editor))
)
runs(() => {
@@ -150,7 +149,7 @@ describe('Workspace', () => {
})
waitsForPromise(() =>
atom.workspace.open('../sample.txt', {pane: getRightDockActivePane()}).then(editor => pane4.activateItem(editor))
atom.workspace.open('../sample.txt', {location: 'right'}).then(editor => pane4.activateItem(editor))
)
runs(() => {