Skip to content

Commit

Permalink
chore: Separate test goals (#1428)
Browse files Browse the repository at this point in the history
* chore: Separate test goals

* Update main.js
  • Loading branch information
bennycode authored and lipis committed May 8, 2018
1 parent 7afbde6 commit 917afa9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {BrowserWindow, Menu, app, ipcMain, session, shell} = require('electron');
// Paths
const APP_PATH = app.getAppPath();

// Local files defines
// Local files
const ABOUT_HTML = fileUrl(path.join(APP_PATH, 'html', 'about.html'));
const ABOUT_WINDOW_WHITELIST = [
ABOUT_HTML,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
"staging": "npm run prestart && electron electron --inspect --devtools --enable-logging --env=https://wire-webapp-staging.zinfra.io",
"start": "electron electron --inspect --devtools --enable-logging",
"test:js": "eslint -c .eslintrc.json --ignore-path .gitignore --ignore-path .eslintignore \"**/*.js\"",
"test:main": "electron-mocha --reporter spec tests/main",
"test:other": "npm run prettier -- --list-different",
"test": "npm run test:other && npm run test:js && npm run jest && electron-mocha tests"
"test:react": "jest",
"test": "npm run test:other && npm run test:js && npm run test:react && npm run test:main"
}
}
23 changes: 11 additions & 12 deletions tests/trayTest.js → tests/main/trayTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,27 @@
'use strict';

const {BrowserWindow, app} = require('electron');
const environment = require('../electron/js/environment');
const environment = require('../../electron/js/environment');

const assert = require('assert');
const path = require('path');

const tray = require('../electron/js/menu/tray');
const tray = require('../../electron/js/menu/tray');

describe('tray', () => {
describe('#updateBadgeIcon()', () => {
it('should update badge according to window title', done => {
describe('"updateBadgeIcon"', () => {
it('updates badge according to window title', done => {
const window = new BrowserWindow();

window.loadURL(`file://${path.join(__dirname, 'fixtures', 'badge.html')}`);
window.webContents.on('dom-ready', () => {
tray.updateBadgeIcon(window, 10);

if (environment.platform.IS_MAC_OS) {
if (environment.platform.IS_MAC_OS) {
window.webContents.on('dom-ready', () => {
tray.updateBadgeIcon(window, 10);
assert.equal(app.getBadgeCount(), 10);
}

done();
});
} else {
done();
});
}
});
});
});

0 comments on commit 917afa9

Please sign in to comment.