test(aio): add sidenav tests and refactor related tests

This commit is contained in:
Ward Bell
2017-04-11 16:08:53 -07:00
committed by Hans
parent 8cfa58715c
commit f09fd6ec16
4 changed files with 174 additions and 98 deletions

View File

@ -5,9 +5,11 @@ export class MockLocationService {
currentUrl = this.urlSubject.asObservable();
search = jasmine.createSpy('search').and.returnValue({});
setSearch = jasmine.createSpy('setSearch');
go = jasmine.createSpy('Location.go');
go = jasmine.createSpy('Location.go').and
.callFake((url: string) => this.urlSubject.next(url));
handleAnchorClick = jasmine.createSpy('Location.handleAnchorClick')
.and.returnValue(false); // prevent click from causing a browser navigation
constructor(private initialUrl) {}
}