From 72723646dd7719f57cf13eb1ea5b9d448f868f99 Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Thu, 9 Feb 2017 21:23:02 +0800 Subject: [PATCH] Add tests to check errors in parameters --- spec/api-dialog-spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/api-dialog-spec.js b/spec/api-dialog-spec.js index 9b90b0353dc2..a07548e9535b 100644 --- a/spec/api-dialog-spec.js +++ b/spec/api-dialog-spec.js @@ -19,6 +19,10 @@ describe('dialog module', () => { assert.throws(() => { dialog.showOpenDialog({defaultPath: {}}) }, /Default path must be a string/) + + assert.throws(() => { + dialog.showOpenDialog({message: {}}) + }, /Message must be a string/) }) }) @@ -35,6 +39,14 @@ describe('dialog module', () => { assert.throws(() => { dialog.showSaveDialog({defaultPath: {}}) }, /Default path must be a string/) + + assert.throws(() => { + dialog.showSaveDialog({message: {}}) + }, /Message must be a string/) + + assert.throws(() => { + dialog.showSaveDialog({nameFieldLabel: {}}) + }, /Name field label must be a string/) }) })