Disable audio notifications on Windows 7 and lower
This commit is contained in:
@@ -23,6 +23,21 @@ describe('Settings', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context('on Windows', () => {
|
context('on Windows', () => {
|
||||||
|
context('version 7', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
sandbox.stub(process, 'platform').value('win32');
|
||||||
|
sandbox.stub(os, 'release').returns('7.0.0');
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
sandbox.restore();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false', () => {
|
||||||
|
assert.isFalse(Settings.isAudioNotificationSupported());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
context('version 8+', () => {
|
context('version 8+', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
sandbox.stub(process, 'platform').value('win32');
|
sandbox.stub(process, 'platform').value('win32');
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
import * as OS from '../OS';
|
import * as OS from '../OS';
|
||||||
|
|
||||||
|
const MIN_WINDOWS_VERSION = '8.0.0';
|
||||||
|
|
||||||
export const isAudioNotificationSupported = () =>
|
export const isAudioNotificationSupported = () =>
|
||||||
OS.isWindows() || OS.isMacOS();
|
OS.isWindows(MIN_WINDOWS_VERSION) || OS.isMacOS();
|
||||||
|
Reference in New Issue
Block a user