Skip to content

Commit aafb456

Browse files
author
Emmanouil Konstantinidis
committed
Coverage 100% for settings store
1 parent 94467ba commit aafb456

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/js/__tests__/stores/settings.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,44 @@ describe('Tests for SettingsStore', function () {
5555
});
5656

5757
});
58+
59+
60+
describe('Tests for SettingsStore', function () {
61+
62+
var SettingsStore, Actions;
63+
64+
beforeEach(function () {
65+
66+
// Mock Electron's window.require
67+
window.require = function () {
68+
return {
69+
sendChannel: function () {
70+
return;
71+
}
72+
};
73+
};
74+
75+
// Mock localStorage
76+
window.localStorage = {
77+
item: false,
78+
getItem: function () {
79+
return '{}';
80+
},
81+
setItem: function (item) {
82+
this.item = item;
83+
}
84+
};
85+
86+
Actions = require('../../actions/actions.js');
87+
SettingsStore = require('../../stores/settings.js');
88+
});
89+
90+
it('should get the settings as string', function () {
91+
92+
spyOn(SettingsStore, 'trigger');
93+
94+
SettingsStore.getSettings();
95+
96+
});
97+
98+
});

0 commit comments

Comments
 (0)