Add tests for `Settings.shouldShowAudioNotificationSetting`

pull/1/head
Daniel Gasienica 7 years ago
parent a98a7ba690
commit 105eb95391

@ -0,0 +1,53 @@
const sinon = require('sinon');
const { assert } = require('chai');
const Settings = require('../../../js/modules/types/settings');
describe('Settings', () => {
const sandbox = sinon.createSandbox();
describe('shouldShowAudioNotificationSetting', () => {
context('on macOS', () => {
beforeEach(() => {
sandbox.stub(process, 'platform').value('darwin');
});
afterEach(() => {
sandbox.restore();
});
it('should return true', () => {
assert.isTrue(Settings.shouldShowAudioNotificationSetting());
});
});
context('on Windows', () => {
beforeEach(() => {
sandbox.stub(process, 'platform').value('win32');
});
afterEach(() => {
sandbox.restore();
});
it('should return true', () => {
assert.isTrue(Settings.shouldShowAudioNotificationSetting());
});
});
context('on Linux', () => {
beforeEach(() => {
sandbox.stub(process, 'platform').value('linux');
});
afterEach(() => {
sandbox.restore();
});
it('should return false', () => {
assert.isFalse(Settings.shouldShowAudioNotificationSetting());
});
});
});
});
Loading…
Cancel
Save