Add tests for Settings.shouldShowAudioNotificationSetting
This commit is contained in:
parent
a98a7ba690
commit
105eb95391
1 changed files with 53 additions and 0 deletions
53
test/modules/types/settings_test.js
Normal file
53
test/modules/types/settings_test.js
Normal 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());
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue