This commit is contained in:
Daniel Pham 2016-12-12 13:05:01 -05:00
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ 2fa9ca1f6d
ΠšΠΎΠΌΠΌΠΈΡ‚ 4b53cd9c3c
2 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 7 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 7 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -61,9 +61,7 @@ module.exports = {
if (properties == null) {
properties = ['openFile']
}
if (!Array.isArray(properties)) {
} else if (!Array.isArray(properties)) {
throw new TypeError('Properties must be an array')
}
@ -167,7 +165,9 @@ module.exports = {
throw new TypeError('Invalid message box type')
}
if (!Array.isArray(buttons)) {
if (buttons == null) {
buttons = []
} else if (!Array.isArray(buttons)) {
throw new TypeError('Buttons must be an array')
}

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -49,15 +49,15 @@ describe('dialog module', () => {
}, /Buttons must be an array/)
assert.throws(() => {
dialog.showMessageBox({title: 300, buttons: ['OK']})
dialog.showMessageBox({title: 300})
}, /Title must be a string/)
assert.throws(() => {
dialog.showMessageBox({message: [], buttons: ['OK']})
dialog.showMessageBox({message: []})
}, /Message must be a string/)
assert.throws(() => {
dialog.showMessageBox({detail: 3.14, buttons: ['OK']})
dialog.showMessageBox({detail: 3.14})
}, /Detail must be a string/)
})
})