| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | import { | 
					
						
							|  |  |  |   AsyncTestCompleter, | 
					
						
							|  |  |  |   describe, | 
					
						
							|  |  |  |   proxy, | 
					
						
							|  |  |  |   it, | 
					
						
							|  |  |  |   iit, | 
					
						
							|  |  |  |   ddescribe, | 
					
						
							|  |  |  |   expect, | 
					
						
							|  |  |  |   inject, | 
					
						
							|  |  |  |   beforeEach, | 
					
						
							| 
									
										
										
										
											2015-08-26 11:41:41 -07:00
										 |  |  |   beforeEachBindings | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | } from 'angular2/test_lib'; | 
					
						
							| 
									
										
										
										
											2015-08-26 11:41:41 -07:00
										 |  |  | import {SpyRouterOutlet} from './spies'; | 
					
						
							|  |  |  | import {Type} from 'angular2/src/core/facade/lang'; | 
					
						
							| 
									
										
										
										
											2015-08-20 14:28:25 -07:00
										 |  |  | import {Promise, PromiseWrapper, ObservableWrapper} from 'angular2/src/core/facade/async'; | 
					
						
							|  |  |  | import {ListWrapper} from 'angular2/src/core/facade/collection'; | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | import {Router, RootRouter} from 'angular2/src/router/router'; | 
					
						
							|  |  |  | import {SpyLocation} from 'angular2/src/mock/location_mock'; | 
					
						
							|  |  |  | import {Location} from 'angular2/src/router/location'; | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  | import {stringifyInstruction} from 'angular2/src/router/instruction'; | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | import {RouteRegistry} from 'angular2/src/router/route_registry'; | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  | import {RouteConfig, AsyncRoute, Route} from 'angular2/src/router/route_config_decorator'; | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-03 22:01:36 -07:00
										 |  |  | import {bind} from 'angular2/core'; | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							|  |  |  |   describe('Router', () => { | 
					
						
							|  |  |  |     var router, location; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     beforeEachBindings(() => [ | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  |       RouteRegistry, | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |       DirectiveResolver, | 
					
						
							|  |  |  |       bind(Location).toClass(SpyLocation), | 
					
						
							| 
									
										
										
										
											2015-06-03 13:42:57 -07:00
										 |  |  |       bind(Router) | 
					
						
							| 
									
										
										
										
											2015-08-24 14:39:54 -07:00
										 |  |  |           .toFactory((registry, location) => { return new RootRouter(registry, location, AppCmp); }, | 
					
						
							|  |  |  |                      [RouteRegistry, Location]) | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |     ]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     beforeEach(inject([Router, Location], (rtr, loc) => { | 
					
						
							|  |  |  |       router = rtr; | 
					
						
							|  |  |  |       location = loc; | 
					
						
							|  |  |  |     })); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should navigate based on the initial URL state', inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 16:12:48 -07:00
										 |  |  |          router.config([new Route({path: '/', component: DummyComponent})]) | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |              .then((_) => router.registerPrimaryOutlet(outlet)) | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |                expect(location.urlChanges).toEqual([]); | 
					
						
							|  |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should activate viewports and update URL on navigate', | 
					
						
							|  |  |  |        inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |          router.registerPrimaryOutlet(outlet) | 
					
						
							| 
									
										
										
										
											2015-07-13 16:12:48 -07:00
										 |  |  |              .then((_) => router.config([new Route({path: '/a', component: DummyComponent})])) | 
					
						
							| 
									
										
										
										
											2015-09-08 21:41:56 -07:00
										 |  |  |              .then((_) => router.navigateByUrl('/a')) | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |                expect(location.urlChanges).toEqual(['/a']); | 
					
						
							|  |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-08 21:42:23 -07:00
										 |  |  |     it('should activate viewports and update URL when navigating via DSL', | 
					
						
							|  |  |  |        inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |          router.registerPrimaryOutlet(outlet) | 
					
						
							|  |  |  |              .then((_) => | 
					
						
							|  |  |  |                        router.config([new Route({path: '/a', component: DummyComponent, as: 'A'})])) | 
					
						
							|  |  |  |              .then((_) => router.navigate(['/A'])) | 
					
						
							|  |  |  |              .then((_) => { | 
					
						
							|  |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							|  |  |  |                expect(location.urlChanges).toEqual(['/a']); | 
					
						
							|  |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-28 01:46:09 -04:00
										 |  |  |     it('should not push a history change on when navigate is called with skipUrlChange', | 
					
						
							|  |  |  |        inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |          router.registerPrimaryOutlet(outlet) | 
					
						
							| 
									
										
										
										
											2015-07-28 01:46:09 -04:00
										 |  |  |              .then((_) => router.config([new Route({path: '/b', component: DummyComponent})])) | 
					
						
							| 
									
										
										
										
											2015-09-08 21:41:56 -07:00
										 |  |  |              .then((_) => router.navigateByUrl('/b', true)) | 
					
						
							| 
									
										
										
										
											2015-07-28 01:46:09 -04:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							| 
									
										
										
										
											2015-07-28 01:46:09 -04:00
										 |  |  |                expect(location.urlChanges).toEqual([]); | 
					
						
							|  |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |     it('should navigate after being configured', inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |          router.registerPrimaryOutlet(outlet) | 
					
						
							| 
									
										
										
										
											2015-09-08 21:41:56 -07:00
										 |  |  |              .then((_) => router.navigateByUrl('/a')) | 
					
						
							| 
									
										
										
										
											2015-06-03 13:42:57 -07:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).not.toHaveBeenCalled(); | 
					
						
							| 
									
										
										
										
											2015-07-13 16:12:48 -07:00
										 |  |  |                return router.config([new Route({path: '/a', component: DummyComponent})]); | 
					
						
							| 
									
										
										
										
											2015-06-03 13:42:57 -07:00
										 |  |  |              }) | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should throw when linkParams does not start with a "/" or "./"', () => { | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |       expect(() => router.generate(['FirstCmp', 'SecondCmp'])) | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  |           .toThrowError( | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |               `Link "${ListWrapper.toJSON(['FirstCmp', 'SecondCmp'])}" must start with "/", "./", or "../"`); | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should throw when linkParams does not include a route name', () => { | 
					
						
							|  |  |  |       expect(() => router.generate(['./'])) | 
					
						
							|  |  |  |           .toThrowError(`Link "${ListWrapper.toJSON(['./'])}" must include a route name.`); | 
					
						
							|  |  |  |       expect(() => router.generate(['/'])) | 
					
						
							|  |  |  |           .toThrowError(`Link "${ListWrapper.toJSON(['/'])}" must include a route name.`); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-18 11:30:32 -07:00
										 |  |  |     it('should, when subscribed to, return a disposable subscription', () => { | 
					
						
							|  |  |  |       expect(() => { | 
					
						
							|  |  |  |         var subscription = router.subscribe((_) => {}); | 
					
						
							|  |  |  |         ObservableWrapper.dispose(subscription); | 
					
						
							|  |  |  |       }).not.toThrow(); | 
					
						
							|  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     it('should generate URLs from the root component when the path starts with /', () => { | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |       router.config([new Route({path: '/first/...', component: DummyParentComp, as: 'FirstCmp'})]); | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |       var instruction = router.generate(['/FirstCmp', 'SecondCmp']); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |       expect(stringifyInstruction(instruction)).toEqual('first/second'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |       instruction = router.generate(['/FirstCmp/SecondCmp']); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |       expect(stringifyInstruction(instruction)).toEqual('first/second'); | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  |     it('should generate an instruction with terminal async routes', | 
					
						
							|  |  |  |        inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |          router.registerPrimaryOutlet(outlet); | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  |          router.config([new AsyncRoute({path: '/first', loader: loader, as: 'FirstCmp'})]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |          var instruction = router.generate(['/FirstCmp']); | 
					
						
							| 
									
										
										
										
											2015-09-08 21:41:56 -07:00
										 |  |  |          router.navigateByInstruction(instruction) | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  |              .then((_) => { | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |                expect(outlet.spy('activate')).toHaveBeenCalled(); | 
					
						
							|  |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should return whether a given instruction is active with isRouteActive', | 
					
						
							|  |  |  |        inject([AsyncTestCompleter], (async) => { | 
					
						
							|  |  |  |          var outlet = makeDummyOutlet(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |          router.registerPrimaryOutlet(outlet) | 
					
						
							|  |  |  |              .then((_) => router.config([ | 
					
						
							|  |  |  |                new Route({path: '/a', component: DummyComponent, as: 'A'}), | 
					
						
							|  |  |  |                new Route({path: '/b', component: DummyComponent, as: 'B'}) | 
					
						
							|  |  |  |              ])) | 
					
						
							| 
									
										
										
										
											2015-09-08 21:41:56 -07:00
										 |  |  |              .then((_) => router.navigateByUrl('/a')) | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |              .then((_) => { | 
					
						
							|  |  |  |                var instruction = router.generate(['/A']); | 
					
						
							|  |  |  |                var otherInstruction = router.generate(['/B']); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                expect(router.isRouteActive(instruction)).toEqual(true); | 
					
						
							|  |  |  |                expect(router.isRouteActive(otherInstruction)).toEqual(false); | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  |                async.done(); | 
					
						
							|  |  |  |              }); | 
					
						
							|  |  |  |        })); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |     describe('query string params', () => { | 
					
						
							|  |  |  |       it('should use query string params for the root route', () => { | 
					
						
							|  |  |  |         router.config( | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |             [new Route({path: '/hi/how/are/you', component: DummyComponent, as: 'GreetingUrl'})]); | 
					
						
							| 
									
										
										
										
											2015-07-21 01:26:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |         var instruction = router.generate(['/GreetingUrl', {'name': 'brad'}]); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |         var path = stringifyInstruction(instruction); | 
					
						
							|  |  |  |         expect(path).toEqual('hi/how/are/you?name=brad'); | 
					
						
							|  |  |  |       }); | 
					
						
							| 
									
										
										
										
											2015-07-21 01:26:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |       it('should serialize parameters that are not part of the route definition as query string params', | 
					
						
							| 
									
										
										
										
											2015-07-21 01:26:43 -07:00
										 |  |  |          () => { | 
					
						
							|  |  |  |            router.config( | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |                [new Route({path: '/one/two/:three', component: DummyComponent, as: 'NumberUrl'})]); | 
					
						
							| 
									
										
										
										
											2015-07-21 01:26:43 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |            var instruction = router.generate(['/NumberUrl', {'three': 'three', 'four': 'four'}]); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |            var path = stringifyInstruction(instruction); | 
					
						
							|  |  |  |            expect(path).toEqual('one/two/three?four=four'); | 
					
						
							| 
									
										
										
										
											2015-07-21 01:26:43 -07:00
										 |  |  |          }); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  |     describe('matrix params', () => { | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |       it('should generate matrix params for each non-root component', () => { | 
					
						
							| 
									
										
										
										
											2015-07-13 16:12:48 -07:00
										 |  |  |         router.config( | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |             [new Route({path: '/first/...', component: DummyParentComp, as: 'FirstCmp'})]); | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |         var instruction = | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |             router.generate(['/FirstCmp', {'key': 'value'}, 'SecondCmp', {'project': 'angular'}]); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |         var path = stringifyInstruction(instruction); | 
					
						
							|  |  |  |         expect(path).toEqual('first/second;project=angular?key=value'); | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  |       }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |       it('should work with named params', () => { | 
					
						
							|  |  |  |         router.config( | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |             [new Route({path: '/first/:token/...', component: DummyParentComp, as: 'FirstCmp'})]); | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |         var instruction = | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  |             router.generate(['/FirstCmp', {'token': 'min'}, 'SecondCmp', {'author': 'max'}]); | 
					
						
							| 
									
										
										
										
											2015-07-17 13:36:53 -07:00
										 |  |  |         var path = stringifyInstruction(instruction); | 
					
						
							|  |  |  |         expect(path).toEqual('first/min/second;author=max'); | 
					
						
							|  |  |  |       }); | 
					
						
							| 
									
										
										
										
											2015-07-08 10:57:38 -07:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-14 12:31:56 -07:00
										 |  |  | function loader(): Promise<Type> { | 
					
						
							|  |  |  |   return PromiseWrapper.resolve(DummyComponent); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-21 13:59:14 -07:00
										 |  |  | class DummyComponent {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-14 17:36:32 -07:00
										 |  |  | @RouteConfig([new Route({path: '/second', component: DummyComponent, as: 'SecondCmp'})]) | 
					
						
							| 
									
										
										
										
											2015-07-06 17:41:15 -07:00
										 |  |  | class DummyParentComp { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  | function makeDummyOutlet() { | 
					
						
							| 
									
										
										
										
											2015-08-26 11:41:41 -07:00
										 |  |  |   var ref = new SpyRouterOutlet(); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |   ref.spy('canActivate').andCallFake((_) => PromiseWrapper.resolve(true)); | 
					
						
							| 
									
										
										
										
											2015-07-07 15:44:29 -07:00
										 |  |  |   ref.spy('canReuse').andCallFake((_) => PromiseWrapper.resolve(false)); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |   ref.spy('canDeactivate').andCallFake((_) => PromiseWrapper.resolve(true)); | 
					
						
							| 
									
										
										
										
											2015-08-30 21:25:46 -07:00
										 |  |  |   ref.spy('activate').andCallFake((_) => PromiseWrapper.resolve(true)); | 
					
						
							| 
									
										
										
										
											2015-05-29 14:58:41 -07:00
										 |  |  |   return ref; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AppCmp {} |