Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #99 from atdrago/feature/adam/testing
Browse files Browse the repository at this point in the history
Feature/adam/testing
  • Loading branch information
atdrago committed May 21, 2016
2 parents b70ec0b + e895ba4 commit db7fafb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
1 change: 0 additions & 1 deletion lib/negative-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = {
}

// Negative
ipcMain.on('test-quit-negative', () => simulateMenuClick(['Negative', 'Quit Negative']));
ipcMain.on('test-reset', () => simulateMenuClick(['Negative', 'Reset...']));
ipcMain.on('test-preferences', () => simulateMenuClick(['Negative', 'Preferences...']));

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"load-grunt-tasks": "^3.5.0",
"mocha": "^2.4.5",
"run-sequence": "^1.1.5",
"spectron": "^3.0.0",
"spectron": "^3.1.0",
"uglify-js": "mishoo/UglifyJS2.git#harmony"
},
"engines": {
Expand Down
10 changes: 1 addition & 9 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ describe.skip('Negative', function () {
}
});

describe('Menues', () => {
describe.skip('Negative -> Quit', () => {
it('Quit Negative', () => {
return app.electron.ipcRenderer.send('test-quit-negative')
.then(() => app.client.getWindowCount())
.then((count) => assert.strictEqual(count, 0));
});
});

describe('Menues', () => {
describe('View', () => {
it('Actual Size', () => {
return app.electron.ipcRenderer.send('test-capture')
Expand Down
36 changes: 36 additions & 0 deletions test/tests/menu/negative/quit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

const { Application } = require('spectron');
const { assert } = require('chai');

const APP_PATH = './dist/Negative-darwin-x64/Negative.app/Contents/MacOS/Negative';

describe('Negative > Quit', function () {
const app = new Application({
path: APP_PATH,
env: {
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
NEGATIVE_IGNORE_WINDOW_SETTINGS: true,
NEGATIVE_SKIP_RESET_DIALOG: true,
NODE_ENV: 'development'
}
});

this.timeout(60000);

beforeEach(() => {
return app.start();
});

afterEach(() => {
if (app && app.isRunning()) {
return app.stop();
}
});

it('Should quit', () => {
// @TODO - This should test that settings are saved (or at least written)
return app.stop().then(() => assert.isFalse(app.isRunning()));
});
});

0 comments on commit db7fafb

Please sign in to comment.