Files
atom/spec/integration/smoke-spec.coffee
Antonio Scandurra 5b57669859 Disable telemetry on AtomApplication tests and smoke-spec.coffee
Unless a choice has been made by the user, this tab always shows up as
the first one when opening Atom, thus breaking some of the assumptions
we make in the main process tests.
2016-08-26 15:13:37 +02:00

33 lines
1.1 KiB
CoffeeScript

fs = require 'fs-plus'
path = require 'path'
season = require 'season'
temp = require('temp').track()
runAtom = require './helpers/start-atom'
describe "Smoke Test", ->
atomHome = temp.mkdirSync('atom-home')
beforeEach ->
jasmine.useRealClock()
season.writeFileSync(path.join(atomHome, 'config.cson'), {
'*': {
welcome: {showOnStartup: false},
core: {telemetryConsent: 'no'}
}
})
it "can open a file in Atom and perform basic operations on it", ->
tempDirPath = temp.mkdirSync("empty-dir")
runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) ->
client
.treeViewRootDirectories()
.then ({value}) -> expect(value).toEqual([tempDirPath])
.waitForExist("atom-text-editor", 5000)
.then (exists) -> expect(exists).toBe true
.waitForPaneItemCount(1, 1000)
.click("atom-text-editor")
.keys("Hello!")
.execute -> atom.workspace.getActiveTextEditor().getText()
.then ({value}) -> expect(value).toBe "Hello!"
.dispatchCommand("editor:delete-line")