@@ -115,12 +115,12 @@ describe('stateService', function () {
115
115
} ) ;
116
116
117
117
it ( "should not update the URL in response to synchronizing URL" , ( ( done ) => {
118
- $loc . setUrl ( '/a/b/c' ) ;
119
- var setUrl = spyOn ( $loc , 'setUrl ' ) . and . callThrough ( ) ;
118
+ $loc . url ( '/a/b/c' ) ;
119
+ var url = spyOn ( $loc , 'url ' ) . and . callThrough ( ) ;
120
120
121
121
wait ( ) . then ( ( ) => {
122
122
expect ( $state . current . name ) . toBe ( 'C' ) ;
123
- let pushedUrls = setUrl . calls . all ( ) . map ( x => x . args [ 0 ] ) . filter ( x => x !== undefined ) ;
123
+ let pushedUrls = url . calls . all ( ) . map ( x => x . args [ 0 ] ) . filter ( x => x !== undefined ) ;
124
124
expect ( pushedUrls ) . toEqual ( [ ] ) ;
125
125
expect ( $loc . path ( ) ) . toBe ( '/a/b/c' ) ;
126
126
done ( ) ;
@@ -130,12 +130,12 @@ describe('stateService', function () {
130
130
it ( "should update the URL in response to synchronizing URL then redirecting" , ( ( done ) => {
131
131
$transitions . onStart ( { to : 'C' } , ( ) => $state . target ( 'D' ) ) ;
132
132
133
- $loc . setUrl ( '/a/b/c' ) ;
134
- var setUrl = spyOn ( $loc , 'setUrl ' ) . and . callThrough ( ) ;
133
+ $loc . url ( '/a/b/c' ) ;
134
+ var url = spyOn ( $loc , 'url ' ) . and . callThrough ( ) ;
135
135
136
136
wait ( ) . then ( ( ) => {
137
137
expect ( $state . current . name ) . toBe ( 'D' ) ;
138
- let pushedUrls = setUrl . calls . all ( ) . map ( x => x . args [ 0 ] ) . filter ( x => x !== undefined ) ;
138
+ let pushedUrls = url . calls . all ( ) . map ( x => x . args [ 0 ] ) . filter ( x => x !== undefined ) ;
139
139
expect ( pushedUrls ) . toEqual ( [ '/a/b/c/d' ] ) ;
140
140
expect ( $loc . path ( ) ) . toBe ( '/a/b/c/d' ) ;
141
141
done ( ) ;
@@ -176,7 +176,7 @@ describe('stateService', function () {
176
176
var dynamicstate , childWithParam , childNoParam ;
177
177
178
178
beforeEach ( async function ( done ) {
179
- $loc . setUrl ( "asdfasfdasf" ) ;
179
+ $loc . url ( "asdfasfdasf" ) ;
180
180
dynlog = paramsChangedLog = "" ;
181
181
dynamicstate = {
182
182
name : 'dyn' ,
@@ -368,7 +368,7 @@ describe('stateService', function () {
368
368
done ( ) ;
369
369
} ) ;
370
370
371
- $loc . setUrl ( '/dynstate/p1/pd1?search=s1&searchDyn=sd2' ) ;
371
+ $loc . url ( '/dynstate/p1/pd1?search=s1&searchDyn=sd2' ) ;
372
372
} ) ;
373
373
374
374
it ( 'exits and enters a state when any non-dynamic params change (triggered via url)' , ( done ) => {
@@ -377,7 +377,7 @@ describe('stateService', function () {
377
377
done ( ) ;
378
378
} ) ;
379
379
380
- $loc . setUrl ( '/dynstate/p1/pd1?search=s2&searchDyn=sd2' ) ;
380
+ $loc . url ( '/dynstate/p1/pd1?search=s2&searchDyn=sd2' ) ;
381
381
} ) ;
382
382
383
383
it ( 'does not exit nor enter a state when only dynamic params change (triggered via $state transition)' , async ( done ) => {
@@ -410,7 +410,7 @@ describe('stateService', function () {
410
410
}
411
411
} ) ;
412
412
413
- $loc . setUrl ( '/dynstate/p1/pd1?search=s1&searchDyn=sd2' ) ; // {search: 's1', searchDyn: 'sd2'});
413
+ $loc . url ( '/dynstate/p1/pd1?search=s1&searchDyn=sd2' ) ; // {search: 's1', searchDyn: 'sd2'});
414
414
} ) ;
415
415
416
416
it ( 'updates $stateParams and $location.search when only dynamic params change (triggered via $state transition)' , async ( done ) => {
@@ -443,7 +443,7 @@ describe('stateService', function () {
443
443
} ) ;
444
444
445
445
it ( 'doesn\'t re-enter state (triggered by url change)' , function ( done ) {
446
- $loc . setUrl ( $loc . path ( ) + "?term=hello" ) ;
446
+ $loc . url ( $loc . path ( ) + "?term=hello" ) ;
447
447
awaitTransition ( router ) . then ( ( ) => {
448
448
expect ( $loc . search ( ) ) . toEqual ( { term : 'hello' } ) ;
449
449
expect ( entered ) . toBeFalsy ( ) ;
0 commit comments