| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  | library angular2.test.transform.directive_linker.all_tests; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import 'package:barback/barback.dart'; | 
					
						
							|  |  |  | import 'package:angular2/src/transform/directive_linker/linker.dart'; | 
					
						
							|  |  |  | import 'package:dart_style/dart_style.dart'; | 
					
						
							| 
									
										
										
										
											2015-03-20 15:25:29 -07:00
										 |  |  | import 'package:guinness/guinness.dart'; | 
					
						
							| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | import '../common/read_file.dart'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var formatter = new DartFormatter(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void allTests() { | 
					
						
							|  |  |  |   var reader = new TestAssetReader(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-20 15:25:29 -07:00
										 |  |  |   it('should ensure that dependencies are property chained.', () async { | 
					
						
							| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  |     for (var inputPath in [ | 
					
						
							|  |  |  |       'bar.ng_deps.dart', | 
					
						
							|  |  |  |       'foo.ng_deps.dart', | 
					
						
							|  |  |  |       'index.ng_deps.dart' | 
					
						
							|  |  |  |     ]) { | 
					
						
							|  |  |  |       var expected = | 
					
						
							|  |  |  |           readFile('directive_linker/simple_files/expected/$inputPath'); | 
					
						
							|  |  |  |       inputPath = 'directive_linker/simple_files/$inputPath'; | 
					
						
							|  |  |  |       var actual = formatter | 
					
						
							|  |  |  |           .format(await linkNgDeps(reader, new AssetId('a', inputPath))); | 
					
						
							| 
									
										
										
										
											2015-03-20 15:25:29 -07:00
										 |  |  |       expect(actual).toEqual(expected); | 
					
						
							| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-20 15:25:29 -07:00
										 |  |  |   it('should ensure that exported dependencies are property chained.', | 
					
						
							| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  |       () async { | 
					
						
							|  |  |  |     for (var inputPath in [ | 
					
						
							|  |  |  |       'bar.ng_deps.dart', | 
					
						
							|  |  |  |       'foo.ng_deps.dart', | 
					
						
							|  |  |  |       'index.ng_deps.dart' | 
					
						
							|  |  |  |     ]) { | 
					
						
							|  |  |  |       var expected = | 
					
						
							|  |  |  |           readFile('directive_linker/simple_export_files/expected/$inputPath'); | 
					
						
							|  |  |  |       inputPath = 'directive_linker/simple_export_files/$inputPath'; | 
					
						
							|  |  |  |       var actual = formatter | 
					
						
							|  |  |  |           .format(await linkNgDeps(reader, new AssetId('a', inputPath))); | 
					
						
							| 
									
										
										
										
											2015-03-20 15:25:29 -07:00
										 |  |  |       expect(actual).toEqual(expected); | 
					
						
							| 
									
										
										
										
											2015-03-18 11:17:13 -07:00
										 |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |