Mailspring/spec_integration/logged-in-app-boot-spec.es6
Evan Morikawa 4014b4e187 feat(spec): add config dir to integration specs
Summary:
- You can now pass `--config-dir-path=/some/custom/path` to `./N1.sh`
- `main.coffee` cleaned up a bit. A lot of unused params from legacy Atom
  stuff were still being used
- Integration specs now set the config dir before booting.
- New spec to check for the autoupdater in the app and make sure it's
  pointing at the right place.

Test Plan: script/grunt run-integration-tests

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2331
2015-12-10 10:52:20 -05:00

51 lines
1.5 KiB
JavaScript

import N1Launcher from './helpers/n1-launcher'
import {currentConfig} from './helpers/config-helper'
import {assertBasicWindow} from './helpers/shared-assertions'
describe('Logged in app boot', () => {
beforeAll((done)=>{
// Boot in dev mode with no arguments
this.app = new N1Launcher(["--dev"]);
this.app.mainWindowReady().finally(done);
});
afterAll((done)=> {
if (this.app && this.app.isRunning()) {
this.app.stop().finally(done);
} else {
done()
}
});
it("has the autoupdater pointing to the correct url", () => {
this.app.client.execute(()=>{
app = require('remote').getGlobal('application')
return {
platform: process.platform,
arch: process.arch,
feedUrl: app.autoUpdateManager.feedURL
}
}).then(({value})=>{
base = "https://edgehill.nylas.com/update-check"
config = currentConfig()
email = encodeURIComponent(config.email)
url = `${base}?platform=${value.platform}&arch=${value.arch}&version=${config.version}&id=${config.id}&emails=${email}`
expect(value.feedUrl).toEqual(url)
})
});
assertBasicWindow.call(this)
it("restored its width from file", (done)=> {
this.app.client.getWindowWidth()
.then((result)=>{ expect(result).toBe(1234) })
.finally(done)
});
it("restored its height from file", (done)=> {
this.app.client.getWindowHeight()
.then((result)=>{ expect(result).toBe(789) })
.finally(done)
});
});