Add systemPreferences.getColor specs
This commit is contained in:
parent
663f8f4b54
commit
e7bfd1c959
1 changed files with 16 additions and 0 deletions
|
@ -15,6 +15,22 @@ describe('systemPreferences module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('systemPreferences.getColor(id)', function () {
|
||||||
|
if (process.platform !== 'win32') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
it('throws an error when the id is invalid', function () {
|
||||||
|
assert.throws(function () {
|
||||||
|
systemPreferences.getColor('not-a-color')
|
||||||
|
}, /Unknown color: not-a-color/)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns a hex RGB color string', function () {
|
||||||
|
assert.equal(/^#[0-9A-F]{6}$/i.test(systemPreferences.getColor('window')), true)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('systemPreferences.getUserDefault(key, type)', function () {
|
describe('systemPreferences.getUserDefault(key, type)', function () {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue