Skip to content

Commit 33aa3cb

Browse files
Merge pull request #73 from ekonstantinidis/coverage-cleanup
Clean Up & Improve Coverage
2 parents 37ad3c5 + 229e1e9 commit 33aa3cb

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

main.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ require('crash-reporter').start();
77
var Menu = require('menu');
88
var Tray = require('tray');
99
var BrowserWindow = require('browser-window');
10-
var AutoLaunch = require('auto-launch')
11-
, start = new AutoLaunch({
12-
name: 'Gitify',
13-
path: process.execPath.match(/.*?\.app/)[0]
14-
});
10+
var AutoLaunch = require('auto-launch');
1511

1612
var iconIdle = path.join(__dirname, 'images', 'tray-idleTemplate.png');
1713
var iconActive = path.join(__dirname, 'images', 'tray-active.png');
1814

15+
var autoStart = new AutoLaunch({
16+
name: 'Gitify',
17+
path: process.execPath.match(/.*?\.app/)[0]
18+
});
19+
1920
app.on('ready', function(){
2021
var appIcon = new Tray(iconIdle);
2122
initWindow();
@@ -100,11 +101,11 @@ app.on('ready', function(){
100101
});
101102

102103
ipc.on('startup-enable', function() {
103-
start.enable();
104+
autoStart.enable();
104105
});
105106

106107
ipc.on('startup-disable', function() {
107-
start.disable();
108+
autoStart.disable();
108109
});
109110

110111
ipc.on('app-quit', function() {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
},
121121
"homepage": "https://github.com/ekonstantinidis/gitify",
122122
"dependencies": {
123-
"auto-launch": "^0.1.18",
123+
"auto-launch": "=0.1.18",
124124
"bootstrap": "=3.3.4",
125125
"browserify": "=10.2.1",
126126
"font-awesome": "=4.3.0",
@@ -145,7 +145,7 @@
145145
"grunt-contrib-copy": "=0.8.0",
146146
"grunt-contrib-less": "=1.0.1",
147147
"grunt-contrib-watch": "=0.6.1",
148-
"jest-cli": "=0.4.12",
148+
"jest-cli": "=0.4.17",
149149
"jscs": "^1.13.1",
150150
"jshint-stylish": "=1.0.2",
151151
"jsxhint": "=0.15.0",

src/js/__tests__/stores/settings.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ describe('Tests for SettingsStore', function () {
1717
return {
1818
sendChannel: function () {
1919
return;
20+
},
21+
send: function () {
22+
return;
2023
}
2124
};
2225
};
@@ -39,21 +42,26 @@ describe('Tests for SettingsStore', function () {
3942
it('should get the settings', function () {
4043

4144
spyOn(SettingsStore, 'trigger');
42-
4345
expect(SettingsStore.getSettings().participating).toBe(false);
4446

4547
});
4648

4749
it('should set a setting', function () {
4850

4951
spyOn(SettingsStore, 'trigger');
50-
5152
SettingsStore.onSetSetting('participating', true);
52-
5353
expect(SettingsStore.getSettings().participating).toBe(true);
5454

5555
});
5656

57+
it('should set the setting: openAtStartup ', function () {
58+
59+
spyOn(SettingsStore, 'trigger');
60+
SettingsStore.onSetSetting('openAtStartup', true);
61+
expect(SettingsStore.getSettings().openAtStartup).toBe(true);
62+
63+
});
64+
5765
});
5866

5967
describe('Tests for SettingsStore', function () {

src/js/stores/settings.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var ipc = window.require('ipc');
2+
13
var Reflux = require('reflux');
24
var Actions = require('../actions/actions');
35

@@ -51,7 +53,6 @@ var SettingsStore = Reflux.createStore({
5153
},
5254

5355
handleStartup: function (value) {
54-
var ipc = window.require('ipc');
5556
var method = (value) ? 'startup-enable' : 'startup-disable';
5657
ipc.send(method);
5758
}

0 commit comments

Comments
 (0)