| 
									
										
										
										
											2016-10-19 21:41:04 +01:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-14 00:36:16 +02:00
										 |  |  | import {PropertyBinding} from '@angular/upgrade/src/common/component_info'; | 
					
						
							| 
									
										
										
										
											2016-10-19 21:41:04 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-16 14:42:55 -08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2016-10-19 21:41:04 +01:00
										 |  |  |   describe('PropertyBinding', () => { | 
					
						
							|  |  |  |     it('should process a simple binding', () => { | 
					
						
							| 
									
										
										
										
											2017-03-14 14:55:37 -07:00
										 |  |  |       const binding = new PropertyBinding('someBinding', 'someBinding'); | 
					
						
							| 
									
										
										
										
											2016-10-19 21:41:04 +01:00
										 |  |  |       expect(binding.prop).toEqual('someBinding'); | 
					
						
							|  |  |  |       expect(binding.attr).toEqual('someBinding'); | 
					
						
							|  |  |  |       expect(binding.bracketAttr).toEqual('[someBinding]'); | 
					
						
							|  |  |  |       expect(binding.bracketParenAttr).toEqual('[(someBinding)]'); | 
					
						
							|  |  |  |       expect(binding.parenAttr).toEqual('(someBinding)'); | 
					
						
							|  |  |  |       expect(binding.onAttr).toEqual('onSomeBinding'); | 
					
						
							|  |  |  |       expect(binding.bindAttr).toEqual('bindSomeBinding'); | 
					
						
							|  |  |  |       expect(binding.bindonAttr).toEqual('bindonSomeBinding'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should process a two-part binding', () => { | 
					
						
							| 
									
										
										
										
											2017-03-14 14:55:37 -07:00
										 |  |  |       const binding = new PropertyBinding('someProp', 'someAttr'); | 
					
						
							| 
									
										
										
										
											2016-10-19 21:41:04 +01:00
										 |  |  |       expect(binding.prop).toEqual('someProp'); | 
					
						
							|  |  |  |       expect(binding.attr).toEqual('someAttr'); | 
					
						
							|  |  |  |       expect(binding.bracketAttr).toEqual('[someAttr]'); | 
					
						
							|  |  |  |       expect(binding.bracketParenAttr).toEqual('[(someAttr)]'); | 
					
						
							|  |  |  |       expect(binding.parenAttr).toEqual('(someAttr)'); | 
					
						
							|  |  |  |       expect(binding.onAttr).toEqual('onSomeAttr'); | 
					
						
							|  |  |  |       expect(binding.bindAttr).toEqual('bindSomeAttr'); | 
					
						
							|  |  |  |       expect(binding.bindonAttr).toEqual('bindonSomeAttr'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |