File tree Expand file tree Collapse file tree 2 files changed +1
-18
lines changed
Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -301,10 +301,7 @@ export function createLocation() {
301301}
302302
303303function _stripBasePath ( basePath : string , url : string ) : string {
304- if ( basePath === url ) {
305- return '' ;
306- }
307- return basePath && url . startsWith ( basePath + '/' ) ? url . substring ( basePath . length ) : url ;
304+ return basePath && url . startsWith ( basePath ) ? url . substring ( basePath . length ) : url ;
308305}
309306
310307function _stripIndexHtml ( url : string ) : string {
Original file line number Diff line number Diff line change @@ -266,18 +266,4 @@ describe('Location Class', () => {
266266 expect ( location . normalize ( url ) ) . toBe ( route ) ;
267267 } ) ;
268268 } ) ;
269-
270- describe ( 'location.normalize(url) should return correct route' , ( ) => {
271- it ( 'in case url starts with the substring equals APP_BASE_HREF' , ( ) => {
272- const baseHref = '/en' ;
273- const url = '/enigma' ;
274-
275- TestBed . configureTestingModule ( { providers : [ { provide : APP_BASE_HREF , useValue : baseHref } ] } ) ;
276-
277- const location = TestBed . inject ( Location ) ;
278-
279- expect ( location . normalize ( url ) ) . toBe ( url ) ;
280- expect ( location . normalize ( baseHref + url ) ) . toBe ( url ) ;
281- } ) ;
282- } ) ;
283269} ) ;
You can’t perform that action at this time.
0 commit comments