| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  | // Imports
 | 
					
						
							| 
									
										
										
										
											2018-08-15 13:47:45 +01:00
										 |  |  | import {ChangedPrVisibilityEvent, CreatedBuildEvent} from '../../lib/preview-server/build-events'; | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Tests
 | 
					
						
							| 
									
										
										
										
											2017-06-19 01:15:07 +03:00
										 |  |  | describe('ChangedPrVisibilityEvent', () => { | 
					
						
							|  |  |  |   let evt: ChangedPrVisibilityEvent; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   beforeEach(() => evt = new ChangedPrVisibilityEvent(42, ['foo', 'bar'], true)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a static \'type\' property', () => { | 
					
						
							|  |  |  |     expect(ChangedPrVisibilityEvent.type).toBe('pr.changedVisibility'); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a \'pr\' property', () => { | 
					
						
							|  |  |  |     expect(evt.pr).toBe(42); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a \'shas\' property', () => { | 
					
						
							|  |  |  |     expect(evt.shas).toEqual(['foo', 'bar']); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have an \'isPublic\' property', () => { | 
					
						
							|  |  |  |     expect(evt.isPublic).toBe(true); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  | describe('CreatedBuildEvent', () => { | 
					
						
							|  |  |  |   let evt: CreatedBuildEvent; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-19 01:15:07 +03:00
										 |  |  |   beforeEach(() => evt = new CreatedBuildEvent(42, 'bar', true)); | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a static \'type\' property', () => { | 
					
						
							|  |  |  |     expect(CreatedBuildEvent.type).toBe('build.created'); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a \'pr\' property', () => { | 
					
						
							|  |  |  |     expect(evt.pr).toBe(42); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should have a \'sha\' property', () => { | 
					
						
							|  |  |  |     expect(evt.sha).toBe('bar'); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-19 01:15:07 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |   it('should have an \'isPublic\' property', () => { | 
					
						
							|  |  |  |     expect(evt.isPublic).toBe(true); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  | }); |