chore: improve nativeImage path converter error (#21243)
This commit is contained in:
parent
34452ee69e
commit
d20273f95b
2 changed files with 23 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
import { expect } from 'chai'
|
||||
import { Menu, Tray, nativeImage } from 'electron'
|
||||
import { ifdescribe, ifit } from './spec-helpers'
|
||||
import * as path from 'path'
|
||||
|
||||
describe('tray module', () => {
|
||||
let tray: Tray
|
||||
|
@ -12,6 +13,15 @@ describe('tray module', () => {
|
|||
tray = null as any
|
||||
})
|
||||
|
||||
describe('new Tray', () => {
|
||||
it('throws a descriptive error for a missing file', () => {
|
||||
const badPath = path.resolve('I', 'Do', 'Not', 'Exist')
|
||||
expect(() => {
|
||||
tray = new Tray(badPath)
|
||||
}).to.throw(/Image could not be created from .*/)
|
||||
})
|
||||
})
|
||||
|
||||
ifdescribe(process.platform === 'darwin')('tray get/set ignoreDoubleClickEvents', () => {
|
||||
it('returns false by default', () => {
|
||||
const ignored = tray.getIgnoreDoubleClickEvents()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue