From 2bd47eb67262a79016edb2c9aef220ee766ba607 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 4 Apr 2017 10:49:21 -0700 Subject: [PATCH] Add specs for showCertificateTrustDialog option errors --- spec/api-dialog-spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/api-dialog-spec.js b/spec/api-dialog-spec.js index 6b245c2..601e28c 100644 --- a/spec/api-dialog-spec.js +++ b/spec/api-dialog-spec.js @@ -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/) + }) + }) }) -- 2.7.4