add test for registerDefaults

This commit is contained in:
Shelley Vohr 2017-12-10 11:26:07 -05:00
parent 18ee34f1a1
commit becabdfff2
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -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') {