diff --git a/modules/angular1_router/test/integration/navigation_spec.js b/modules/angular1_router/test/integration/navigation_spec.js
index a266703270..70bcf2eeee 100644
--- a/modules/angular1_router/test/integration/navigation_spec.js
+++ b/modules/angular1_router/test/integration/navigation_spec.js
@@ -36,6 +36,14 @@ describe('navigation', function () {
template: '
{{$ctrl.number}}
',
controller: function () {this.number = 'three'}
});
+ registerComponent('getParams', {
+ template: '{{$ctrl.params.x}}
',
+ controller: function () {
+ this.$routerOnActivate = function(next) {
+ this.params = next.params;
+ };
+ }
+ })
});
it('should work in a simple case', function () {
@@ -186,6 +194,21 @@ describe('navigation', function () {
}));
+ it('should pass through query terms to the location', inject(function ($location) {
+ $router.config([
+ { path: '/user', component: 'userCmp' }
+ ]);
+
+ compile('');
+
+ $router.navigateByUrl('/user?x=y');
+ $rootScope.$digest();
+
+ expect($location.path()).toBe('/user');
+ expect($location.search()).toEqual({ x: 'y'});
+ }));
+
+
it('should change location to the canonical route', inject(function ($location) {
compile('');
@@ -245,6 +268,19 @@ describe('navigation', function () {
}));
+ it('should navigate when the location query changes', inject(function ($location) {
+ $router.config([
+ { path: '/get/params', component: 'getParams' }
+ ]);
+ compile('');
+
+ $location.url('/get/params?x=y');
+ $rootScope.$digest();
+
+ expect(elt.text()).toBe('y');
+ }));
+
+
it('should expose a "navigating" property on $router', inject(function ($q) {
var defer;
registerDirective('pendingActivate', {