test(aio): reimplemented all the commented-out unit tests

This commit is contained in:
Peter Bacon Darwin
2017-03-02 13:28:28 +00:00
committed by Igor Minar
parent 2ebfa2ff31
commit 01ff427685
7 changed files with 340 additions and 272 deletions

View File

@ -1,6 +1,8 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { async, inject, ComponentFixture, TestBed } from '@angular/core/testing';
import { APP_BASE_HREF } from '@angular/common';
import { AppComponent } from './app.component';
import { AppModule } from './app.module';
import { SearchService } from 'app/search/search.service';
describe('AppComponent', () => {
let component: AppComponent;
@ -10,6 +12,7 @@ describe('AppComponent', () => {
TestBed.configureTestingModule({
imports: [ AppModule ],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' }
]
});
TestBed.compileComponents();
@ -23,4 +26,38 @@ describe('AppComponent', () => {
it('should create', () => {
expect(component).toBeDefined();
});
describe('isHamburgerVisible', () => {
});
describe('onResize', () => {
it('should update `isSideBySide` accordingly', () => {
component.onResize(1000);
expect(component.isSideBySide).toBe(true);
component.onResize(500);
expect(component.isSideBySide).toBe(false);
});
});
describe('onSearch', () => {
it('should call the search service', inject([SearchService], (search: SearchService) => {
spyOn(search, 'search');
component.onSearch('some query');
expect(search.search).toHaveBeenCalledWith('some query');
}));
});
describe('currentDocument', () => {
});
describe('navigationViews', () => {
});
describe('searchResults', () => {
});
});