@@ -25,16 +25,21 @@ export function main() {
2525 location = new Location ( browserLocation ) ;
2626 } ) ;
2727
28- it ( 'should normalize urls on navigate' , ( ) => {
28+ it ( 'should normalize relative urls on navigate' , ( ) => {
29+ location . go ( 'user/btford' ) ;
30+ expect ( browserLocation . spy ( 'pushState' ) ) . toHaveBeenCalledWith ( null , '' , '/my/app/user/btford' ) ;
31+ } ) ;
32+
33+ it ( 'should not append urls with leading slash on navigate' , ( ) => {
2934 location . go ( '/my/app/user/btford' ) ;
30- expect ( browserLocation . spy ( 'pushState' ) ) . toHaveBeenCalledWith ( null , '' , '/user/btford' ) ;
35+ expect ( browserLocation . spy ( 'pushState' ) ) . toHaveBeenCalledWith ( null , '' , '/my/app/ user/btford' ) ;
3136 } ) ;
3237
3338 it ( 'should remove index.html from base href' , ( ) => {
3439 browserLocation . baseHref = '/my/app/index.html' ;
3540 location = new Location ( browserLocation ) ;
36- location . go ( '/my/app/ user/btford' ) ;
37- expect ( browserLocation . spy ( 'pushState' ) ) . toHaveBeenCalledWith ( null , '' , '/user/btford' ) ;
41+ location . go ( 'user/btford' ) ;
42+ expect ( browserLocation . spy ( 'pushState' ) ) . toHaveBeenCalledWith ( null , '' , '/my/app/ user/btford' ) ;
3843 } ) ;
3944
4045 it ( 'should normalize urls on popstate' , inject ( [ AsyncTestCompleter ] , ( async ) => {
0 commit comments