add test for registerDefaults
This commit is contained in:
parent
18ee34f1a1
commit
becabdfff2
1 changed files with 17 additions and 0 deletions
|
@ -35,6 +35,23 @@ describe('systemPreferences module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('systemPreferences.registerDefaults(defaults)', () => {
|
||||
it('registers defaults', () => {
|
||||
const userDefaults = {
|
||||
'one': 'onee',
|
||||
'two': 'twoo',
|
||||
'three': 'threee',
|
||||
'four': 'fourr',
|
||||
'five': 'fivee'
|
||||
}
|
||||
|
||||
systemPreferences.registerDefaults(userDefaults)
|
||||
|
||||
const val = systemPreferences.getUserDefault('two', 'string')
|
||||
assert.equal(val, 'twoo')
|
||||
})
|
||||
})
|
||||
|
||||
describe('systemPreferences.getUserDefault(key, type)', () => {
|
||||
before(function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
|
|
Loading…
Reference in a new issue