diff --git a/aio/src/app/nav-engine/doc.service.spec.ts b/aio/src/app/nav-engine/doc.service.spec.ts index 7de0ad073b..cd5d8df0b5 100644 --- a/aio/src/app/nav-engine/doc.service.spec.ts +++ b/aio/src/app/nav-engine/doc.service.spec.ts @@ -9,7 +9,7 @@ import { of } from 'rxjs/observable/of'; import 'rxjs/add/observable/throw'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/delay'; -import 'rxjs/add/operator/take'; +import 'rxjs/add/operator/first'; describe('DocService', () => { let docFetchingService: DocFetchingService; @@ -31,7 +31,7 @@ describe('DocService', () => { loggerSpy = jasmine.createSpyObj('logger', ['log', 'warn', 'error']); docFetchingService = new DocFetchingService(null, loggerSpy); getFileSpy = spyOn(docFetchingService, 'getDocFile').and - .returnValue(of(testDoc).delay(0).take(1)); // take(1) -> completes + .returnValue(of(testDoc).delay(0).first()); // first() -> completes docService = new DocService(docFetchingService, loggerSpy); }); diff --git a/aio/src/app/nav-engine/nav-map.service.spec.ts b/aio/src/app/nav-engine/nav-map.service.spec.ts index 413bcb6092..5943dbba22 100644 --- a/aio/src/app/nav-engine/nav-map.service.spec.ts +++ b/aio/src/app/nav-engine/nav-map.service.spec.ts @@ -19,12 +19,12 @@ describe('NavMapService', () => { beforeEach(done => { httpSpy = jasmine.createSpyObj('http', ['get']); - httpSpy.get.and.returnValue(of(getTestNavMapResponse()).delay(0).take(1)); // take(1) -> completes + httpSpy.get.and.returnValue(of(getTestNavMapResponse()).delay(0).first()); // first() -> completes loggerSpy = jasmine.createSpyObj('logger', ['log', 'warn', 'error']); navMapService = new NavMapService(new DocFetchingService(null, null), httpSpy, loggerSpy); - navMapService.navMap.take(1).subscribe( + navMapService.navMap.first().subscribe( nm => navMap = nm, null, done); diff --git a/aio/src/app/sidenav/sidenav.component.spec.ts b/aio/src/app/sidenav/sidenav.component.spec.ts index ab0d0166c4..f845ce3d11 100644 --- a/aio/src/app/sidenav/sidenav.component.spec.ts +++ b/aio/src/app/sidenav/sidenav.component.spec.ts @@ -51,7 +51,7 @@ describe('SidenavComponent', () => { }; navEngine = { - currentDoc: of(fakeDoc).delay(0).take(1), + currentDoc: of(fakeDoc).delay(0).first(), navigate: (docId: string) => { } } as NavEngine; navigateSpy = spyOn(navEngine, 'navigate'); @@ -69,7 +69,7 @@ describe('SidenavComponent', () => { }; navMapService = { - navMap: of(fakeNavMap).delay(0).take(1) + navMap: of(fakeNavMap).delay(0).first() } as NavMapService; TestBed.configureTestingModule({ diff --git a/aio/src/app/sidenav/sidenav.component.ts b/aio/src/app/sidenav/sidenav.component.ts index b06648a1d0..cc0d39673e 100644 --- a/aio/src/app/sidenav/sidenav.component.ts +++ b/aio/src/app/sidenav/sidenav.component.ts @@ -41,7 +41,7 @@ export class SidenavComponent implements OnInit { // Side effect: when the current doc changes, // get its NavNode and alert the navigation panel this.currentDocId = doc.metadata.docId; - this.navMapService.navMap.take(1) // take makes sure it completes! + this.navMapService.navMap.first() // take makes sure it completes! .map(navMap => navMap.docs.get(this.currentDocId)) .subscribe( node => this.selectedNode.emit(node)); });