|
7 | 7 | */ |
8 | 8 |
|
9 | 9 | import {TestBed} from '@angular/core/testing'; |
10 | | -import {NavigationEnd, NavigationStart, provideRouter, Router} from '../src'; |
| 10 | +import {provideRouter, Router} from '../src'; |
11 | 11 | import {withPlatformNavigation, withRouterConfig} from '../src/provide_router'; |
12 | 12 | import {withBody} from '@angular/private/testing'; |
13 | 13 | import { |
14 | 14 | PlatformLocation, |
15 | 15 | Location, |
16 | 16 | PlatformNavigation, |
17 | 17 | BrowserPlatformLocation, |
18 | | - ɵPRECOMMIT_HANDLER_SUPPORTED as PRECOMMIT_HANDLER_SUPPORTED, |
19 | 18 | } from '@angular/common'; |
20 | 19 | import { |
21 | 20 | ɵFakeNavigation as FakeNavigation, |
22 | 21 | ɵFakeNavigationPlatformLocation as FakeNavigationPlatformLocation, |
23 | 22 | provideLocationMocks, |
24 | 23 | } from '@angular/common/testing'; |
25 | 24 | import {timeout, useAutoTick} from './helpers'; |
26 | | -import {} from '../../common/src/navigation/platform_navigation'; |
27 | | -import {inject} from '@angular/core'; |
28 | 25 |
|
29 | 26 | /// <reference types="dom-navigation" /> |
30 | 27 |
|
@@ -160,26 +157,6 @@ describe('withPlatformNavigation feature', () => { |
160 | 157 | expect(navigateEvents.length).toBe(1); |
161 | 158 | expect(navigateEvents[0].navigationType).toBe('traverse'); |
162 | 159 | }); |
163 | | - |
164 | | - it('retains a single NavigateEvent across redirects', async () => { |
165 | | - const navigateEvents: NavigateEvent[] = []; |
166 | | - navigation.addEventListener('navigate', (e: NavigateEvent) => navigateEvents.push(e)); |
167 | | - |
168 | | - router.resetConfig([ |
169 | | - {path: 'first', canActivate: [() => inject(Router).parseUrl('/redirected')], children: []}, |
170 | | - {path: '**', children: []}, |
171 | | - ]); |
172 | | - const navPromise = router.navigateByUrl('/first'); |
173 | | - if (TestBed.inject(PRECOMMIT_HANDLER_SUPPORTED)) { |
174 | | - router.events.subscribe((e) => { |
175 | | - if (e instanceof NavigationStart) { |
176 | | - expect(navigateEvents.length).toBe(1); |
177 | | - } |
178 | | - }); |
179 | | - } |
180 | | - await navPromise; |
181 | | - expect(navigateEvents.length).toBe(1); |
182 | | - }); |
183 | 160 | }); |
184 | 161 |
|
185 | 162 | describe('eager url update', () => { |
|
0 commit comments