mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
Specs for concurrent opening
This commit is contained in:
parent
112e9f5863
commit
7c9463acea
@ -274,6 +274,21 @@ describe('Workspace', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('discovers existing editors that are still opening', () => {
|
||||
let editor0 = null
|
||||
let editor1 = null
|
||||
|
||||
waitsForPromise(() => Promise.all([
|
||||
workspace.open('spartacus.txt').then(o0 => { editor0 = o0 }),
|
||||
workspace.open('spartacus.txt').then(o1 => { editor1 = o1 }),
|
||||
]))
|
||||
|
||||
runs(() => {
|
||||
expect(editor0).toEqual(editor1)
|
||||
expect(workspace.getActivePane().items).toEqual([editor0])
|
||||
})
|
||||
})
|
||||
|
||||
it("uses the location specified by the model's `getDefaultLocation()` method", () => {
|
||||
const item = {
|
||||
getDefaultLocation: jasmine.createSpy().andReturn('right'),
|
||||
@ -361,6 +376,28 @@ describe('Workspace', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('discovers existing editors that are still opening in an inactive pane', () => {
|
||||
let editor0 = null
|
||||
let editor1 = null
|
||||
const pane0 = workspace.getActivePane()
|
||||
const pane1 = workspace.getActivePane().splitRight()
|
||||
|
||||
pane0.activate()
|
||||
const promise0 = workspace.open('spartacus.txt', {searchAllPanes: true}).then(o0 => { editor0 = o0 })
|
||||
pane1.activate()
|
||||
const promise1 = workspace.open('spartacus.txt', {searchAllPanes: true}).then(o1 => { editor1 = o1 })
|
||||
|
||||
waitsForPromise(() => Promise.all([promise0, promise1]))
|
||||
|
||||
runs(() => {
|
||||
expect(editor0).toBeDefined()
|
||||
expect(editor1).toBeDefined()
|
||||
|
||||
expect(editor0).toEqual(editor1)
|
||||
expect(workspace.getActivePane().items).toEqual([editor0])
|
||||
})
|
||||
})
|
||||
|
||||
it('activates the pane in the dock with the matching item', () => {
|
||||
const dock = atom.workspace.getRightDock()
|
||||
const ITEM_URI = 'atom://test'
|
||||
|
Loading…
Reference in New Issue
Block a user