2019-11-18 22:38:51 +01:00
|
|
|
import rewiremock from 'rewiremock';
|
|
|
|
rewiremock.disable();
|
|
|
|
|
2019-10-06 22:30:24 +02:00
|
|
|
import { expect } from 'chai';
|
2019-10-06 22:29:04 +02:00
|
|
|
import * as electron from 'electron';
|
2019-11-18 22:38:51 +01:00
|
|
|
import 'mocha';
|
2019-10-05 03:09:34 +02:00
|
|
|
import { Application } from 'spectron';
|
2019-10-11 23:10:30 +02:00
|
|
|
import packageJson from '../package.json';
|
2019-10-05 03:09:34 +02:00
|
|
|
|
2019-10-16 21:37:36 +02:00
|
|
|
describe('Application @slow', function() {
|
2019-10-12 16:26:34 +02:00
|
|
|
this.timeout(20000);
|
2019-10-05 03:09:34 +02:00
|
|
|
|
2019-10-16 21:37:36 +02:00
|
|
|
before(function() {
|
2019-10-05 03:09:34 +02:00
|
|
|
this.app = new Application({
|
2019-10-06 22:29:04 +02:00
|
|
|
// @ts-ignore this does give the path to electron executable (hopefully platform agnostic)
|
|
|
|
path: electron.default,
|
2019-10-05 03:09:34 +02:00
|
|
|
args: [packageJson.main],
|
|
|
|
});
|
|
|
|
return this.app.start();
|
|
|
|
});
|
|
|
|
|
2019-10-16 21:37:36 +02:00
|
|
|
after(function() {
|
2019-10-05 03:09:34 +02:00
|
|
|
if (this.app && this.app.isRunning()) {
|
|
|
|
return this.app.stop();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-10-16 21:37:36 +02:00
|
|
|
it('shows an initial window', function() {
|
2019-10-05 03:09:34 +02:00
|
|
|
return this.app.client.getWindowCount().then((count: number) => {
|
2019-10-10 19:44:39 +02:00
|
|
|
expect(count).to.be.gte(1);
|
2019-10-05 03:09:34 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|