mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move another integration test
This commit is contained in:
@@ -40,21 +40,6 @@ describe "Starting Atom", ->
|
||||
.then ({value}) -> expect(value).toBe "Hello!"
|
||||
.dispatchCommand("editor:delete-line")
|
||||
|
||||
describe "when there is an existing window with no project path", ->
|
||||
it "reuses that window to open a directory", ->
|
||||
runAtom [], {ATOM_HOME: atomHome}, (client) ->
|
||||
client
|
||||
.treeViewRootDirectories()
|
||||
.then ({value}) -> expect(value).toEqual([])
|
||||
|
||||
.startAnotherAtom([tempDirPath], ATOM_HOME: atomHome)
|
||||
.waitUntil(->
|
||||
@treeViewRootDirectories()
|
||||
.then ({value}) -> value[0] is tempDirPath
|
||||
, 5000)
|
||||
.then (result) -> expect(result).toBe(true)
|
||||
.waitForWindowCount(1, 5000)
|
||||
|
||||
describe "launching with no path", ->
|
||||
it "doesn't open a new window if openEmptyEditorOnStart is disabled", ->
|
||||
configPath = path.join(atomHome, 'config.cson')
|
||||
|
||||
@@ -235,6 +235,25 @@ describe('AtomApplication', function () {
|
||||
assert.equal(reusedWindow, window1)
|
||||
assert.deepEqual(await getTreeViewRootDirectories(window1), [tempDirPath])
|
||||
})
|
||||
|
||||
it('opens a new window with a single untitled buffer when launched with no path, even if windows already exist', async function () {
|
||||
const atomApplication = buildAtomApplication()
|
||||
const window1 = atomApplication.openWithOptions(parseCommandLine([]))
|
||||
await window1.loadedPromise
|
||||
const window1EditorTitle = await evalInWebContents(window1.browserWindow.webContents, function (sendBackToMainProcess) {
|
||||
sendBackToMainProcess(atom.workspace.getActiveTextEditor().getTitle())
|
||||
})
|
||||
assert.equal(window1EditorTitle, 'untitled')
|
||||
|
||||
const window2 = atomApplication.openWithOptions(parseCommandLine([]))
|
||||
await window2.loadedPromise
|
||||
const window2EditorTitle = await evalInWebContents(window1.browserWindow.webContents, function (sendBackToMainProcess) {
|
||||
sendBackToMainProcess(atom.workspace.getActiveTextEditor().getTitle())
|
||||
})
|
||||
assert.equal(window2EditorTitle, 'untitled')
|
||||
|
||||
assert.deepEqual(atomApplication.windows, [window1, window2])
|
||||
})
|
||||
})
|
||||
|
||||
function buildAtomApplication () {
|
||||
|
||||
Reference in New Issue
Block a user