| 
									
										
										
										
											2018-09-14 02:10:51 +10:00
										 |  |  | const { remote } = require('electron') | 
					
						
							|  |  |  | const { Menu, Tray, nativeImage } = remote | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | describe('tray module', () => { | 
					
						
							| 
									
										
										
										
											2018-08-30 11:16:56 +02:00
										 |  |  |   let tray | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-30 11:16:56 +02:00
										 |  |  |   beforeEach(() => { | 
					
						
							|  |  |  |     tray = new Tray(nativeImage.createEmpty()) | 
					
						
							|  |  |  |   }) | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-30 11:16:56 +02:00
										 |  |  |   afterEach(() => { | 
					
						
							|  |  |  |     tray.destroy() | 
					
						
							|  |  |  |     tray = null | 
					
						
							|  |  |  |   }) | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-30 11:16:56 +02:00
										 |  |  |   describe('tray.setContextMenu', () => { | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  |     it('accepts menu instance', () => { | 
					
						
							|  |  |  |       tray.setContextMenu(new Menu()) | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('accepts null', () => { | 
					
						
							|  |  |  |       tray.setContextMenu(null) | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   }) | 
					
						
							| 
									
										
										
										
											2018-08-30 11:16:56 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   describe('tray.setImage', () => { | 
					
						
							|  |  |  |     it('accepts empty image', () => { | 
					
						
							|  |  |  |       tray.setImage(nativeImage.createEmpty()) | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe('tray.setPressedImage', () => { | 
					
						
							|  |  |  |     it('accepts empty image', () => { | 
					
						
							|  |  |  |       tray.setPressedImage(nativeImage.createEmpty()) | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe('tray.setTitle', () => { | 
					
						
							|  |  |  |     it('accepts non-empty string', () => { | 
					
						
							|  |  |  |       tray.setTitle('Hello World!') | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('accepts empty string', () => { | 
					
						
							|  |  |  |       tray.setTitle('') | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   }) | 
					
						
							| 
									
										
										
										
											2018-08-27 18:58:47 +02:00
										 |  |  | }) |