Add tests for Settings.shouldShowAudioNotificationSetting

This commit is contained in:
Daniel Gasienica 2018-02-26 12:24:29 -05:00
parent a98a7ba690
commit 105eb95391

View file

@ -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());
});
});
});
});