Add specs for showCertificateTrustDialog option errors
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 4 Apr 2017 17:49:21 +0000 (10:49 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Tue, 4 Apr 2017 17:49:21 +0000 (10:49 -0700)
spec/api-dialog-spec.js

index 6b245c2..601e28c 100644 (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/)
+    })
+  })
 })