diff --git a/aio/src/app/app.component.spec.ts b/aio/src/app/app.component.spec.ts index 3565321946..1be070b3f3 100644 --- a/aio/src/app/app.component.spec.ts +++ b/aio/src/app/app.component.spec.ts @@ -723,14 +723,14 @@ describe('AppComponent', () => { expect(TestBed.get(LocationService).replace).not.toHaveBeenCalled(); }); - it('should redirect to `docs` if deployment mode is `next` and not at a docs page', () => { + it('should not redirect if deployment mode is `next`', () => { createTestingModule('', 'next'); initializeTest(); - expect(TestBed.get(LocationService).replace).toHaveBeenCalledWith('docs'); + expect(TestBed.get(LocationService).replace).not.toHaveBeenCalled(); createTestingModule('resources', 'next'); initializeTest(); - expect(TestBed.get(LocationService).replace).toHaveBeenCalledWith('docs'); + expect(TestBed.get(LocationService).replace).not.toHaveBeenCalled(); createTestingModule('guide/aot-compiler', 'next'); initializeTest(); @@ -757,7 +757,7 @@ describe('AppComponent', () => { expect(TestBed.get(LocationService).replace).not.toHaveBeenCalled(); }); - it('should not redirect to `docs` if deployment mode is `stable` and not at a docs page', () => { + it('should not redirect to `docs` if deployment mode is `stable`', () => { createTestingModule('', 'stable'); initializeTest(); expect(TestBed.get(LocationService).replace).not.toHaveBeenCalled(); diff --git a/aio/src/app/app.component.ts b/aio/src/app/app.component.ts index f95b0a2fdf..53c8ac4075 100644 --- a/aio/src/app/app.component.ts +++ b/aio/src/app/app.component.ts @@ -121,9 +121,9 @@ export class AppComponent implements OnInit { this.documentService.currentDocument.first().subscribe(doc => this.updateHostClassesForDoc(doc)); this.locationService.currentPath.subscribe(path => { - // Redirect to docs if we are in not in stable mode and are not hitting a docs page + // Redirect to docs if we are in archive mode and are not hitting a docs page // (i.e. we have arrived at a marketing page) - if (this.deployment.mode !== 'stable' && !/^(docs$|api|guide|tutorial)/.test(path)) { + if (this.deployment.mode === 'archive' && !/^(docs$|api|guide|tutorial)/.test(path)) { this.locationService.replace('docs'); } if (path === this.currentPath) {