Skip to content

Commit 056ea39

Browse files
authored
Merge pull request #38 from Chronos2-0/jenae/testing
Added testing
2 parents 4ba2507 + dbf658d commit 056ea39

File tree

7 files changed

+4403
-1236
lines changed

7 files changed

+4403
-1236
lines changed

Main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,4 @@ ipcMain.on('detailsRequest', (message, index) => {
283283
});
284284
}
285285
});
286+

__tests__/spec.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

__tests__/spectron.test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
const { Application } = require('spectron');
2+
const assert = require('assert');
3+
const path = require('path');
4+
const electronPath = path.join(__dirname, '..', 'node_modules', '.bin', 'electron');
5+
6+
if(process.platform === "win32"){
7+
electronPath += ".cmd";
8+
}
9+
10+
describe('Application launch', function () {
11+
this.timeout(30000);
12+
13+
const app = new Application({
14+
path: electronPath,
15+
args: [path.join(__dirname, '..')],
16+
});
17+
18+
beforeEach(()=>app.start())
19+
afterEach(()=>app.stop())
20+
21+
it('shows an initial window', async () => {
22+
await app.client.waitUntilWindowLoaded();
23+
const count = await app.client.getWindowCount();
24+
assert.equal(count, 1);
25+
});
26+
it('is window is visible', async () =>{
27+
await app.client.waitUntilWindowLoaded();
28+
const isVisible = await app.browserWindow.isVisible();
29+
assert.equal(isVisible, true);
30+
});
31+
it('window title is chronos', async () =>{
32+
await app.client.waitUntilWindowLoaded();
33+
const title = await app.browserWindow.getTitle();
34+
assert.equal(title, 'chronos');
35+
});
36+
});
37+
38+

dist/index_bundle.js

Lines changed: 3438 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)