| 
									
										
										
										
											2016-06-23 09:47:54 -07: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
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-28 17:50:03 -07:00
										 |  |  | import {LowerCasePipe} from '@angular/common'; | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  | import {afterEach, beforeEach, ddescribe, describe, expect, iit, it, xit} from '@angular/core/testing/testing_internal'; | 
					
						
							| 
									
										
										
										
											2015-05-14 10:14:26 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  |   describe('LowerCasePipe', () => { | 
					
						
							| 
									
										
										
										
											2016-06-17 10:57:32 -07:00
										 |  |  |     var upper: string; | 
					
						
							|  |  |  |     var lower: string; | 
					
						
							|  |  |  |     var pipe: LowerCasePipe; | 
					
						
							| 
									
										
										
										
											2015-05-14 10:14:26 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     beforeEach(() => { | 
					
						
							|  |  |  |       lower = 'something'; | 
					
						
							|  |  |  |       upper = 'SOMETHING'; | 
					
						
							|  |  |  |       pipe = new LowerCasePipe(); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  |     describe('transform', () => { | 
					
						
							|  |  |  |       it('should return lowercase', () => { | 
					
						
							| 
									
										
										
										
											2015-05-14 10:14:26 -07:00
										 |  |  |         var val = pipe.transform(upper); | 
					
						
							|  |  |  |         expect(val).toEqual(lower); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  |       it('should lowercase when there is a new value', () => { | 
					
						
							| 
									
										
										
										
											2015-05-14 10:14:26 -07:00
										 |  |  |         var val = pipe.transform(upper); | 
					
						
							|  |  |  |         expect(val).toEqual(lower); | 
					
						
							|  |  |  |         var val2 = pipe.transform('WAT'); | 
					
						
							|  |  |  |         expect(val2).toEqual('wat'); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  |       it('should not support other objects', | 
					
						
							| 
									
										
										
										
											2016-06-17 10:57:32 -07:00
										 |  |  |          () => { expect(() => pipe.transform(<any>{})).toThrowError(); }); | 
					
						
							| 
									
										
										
										
											2015-05-14 10:14:26 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |