Browse Source

Add specs for showCertificateTrustDialog option errors

Kevin Sawicki 8 years ago
parent
commit
2bd47eb672
1 changed files with 16 additions and 0 deletions
  1. 16 0
      spec/api-dialog-spec.js

+ 16 - 0
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/)
+    })
+  })
 })