Add specs for showCertificateTrustDialog option errors

This commit is contained in:
Kevin Sawicki 2017-04-04 10:49:21 -07:00
parent 2e32525e8f
commit 2bd47eb672

View file

@ -93,4 +93,20 @@ describe('dialog module', () => {
}, /Error processing argument at index 1/)
})
})
describe('showCertificateTrustDialog', () => {
it('throws errors when the options are invalid', () => {
assert.throws(() => {
dialog.showCertificateTrustDialog()
}, /options must be an object/)
assert.throws(() => {
dialog.showCertificateTrustDialog({})
}, /certificate must be an object/)
assert.throws(() => {
dialog.showCertificateTrustDialog({certificate: {}, message: false})
}, /message must be a string/)
})
})
})