-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDA-4182: Add GPOs to auto update channel (#1896)
- Loading branch information
1 parent
7d23cd6
commit 15056f1
Showing
5 changed files
with
282 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { retrieveWindowsRegistry } from '../src/app/registry-handler'; | ||
import { | ||
EChannelRegistry, | ||
RegistryStore, | ||
} from '../src/app/stores/registry-store'; | ||
|
||
let mockChannel = { value: '', type: 'REG_SZ' }; | ||
|
||
jest.mock('winreg', () => { | ||
return jest.fn().mockImplementation(() => { | ||
return { | ||
get: (_file, callback) => callback(null, mockChannel), | ||
}; | ||
}); | ||
}); | ||
|
||
jest.mock('../src/common/env', () => { | ||
return { | ||
isWindowsOS: true, | ||
isLinux: false, | ||
isMac: false, | ||
isDevEnv: true, | ||
}; | ||
}); | ||
|
||
describe('Windows Registry', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks().resetModules(); | ||
}); | ||
|
||
it('it should return channel - latest', async () => { | ||
mockChannel.value = 'latest'; | ||
await retrieveWindowsRegistry(); | ||
const registry = RegistryStore.getRegistry(); | ||
expect(registry.currentChannel).toBe(EChannelRegistry.LATEST); | ||
}); | ||
|
||
it('it should return channel - beta', async () => { | ||
mockChannel.value = 'beta'; | ||
await retrieveWindowsRegistry(); | ||
const registry = RegistryStore.getRegistry(); | ||
expect(registry.currentChannel).toBe(EChannelRegistry.BETA); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.