2017-03-02 13:28:28 +00:00
|
|
|
import { async, inject, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
|
|
import { APP_BASE_HREF } from '@angular/common';
|
2017-02-02 23:02:23 -08:00
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { AppModule } from './app.module';
|
2017-03-02 13:28:28 +00:00
|
|
|
import { SearchService } from 'app/search/search.service';
|
2017-02-02 23:02:23 -08:00
|
|
|
|
2017-01-27 00:20:51 -08:00
|
|
|
describe('AppComponent', () => {
|
2017-02-02 23:02:23 -08:00
|
|
|
let component: AppComponent;
|
|
|
|
let fixture: ComponentFixture<AppComponent>;
|
2017-01-27 00:20:51 -08:00
|
|
|
|
2017-02-02 23:02:23 -08:00
|
|
|
beforeEach(async(() => {
|
|
|
|
TestBed.configureTestingModule({
|
|
|
|
imports: [ AppModule ],
|
|
|
|
providers: [
|
2017-03-02 13:28:28 +00:00
|
|
|
{ provide: APP_BASE_HREF, useValue: '/' }
|
2017-02-02 23:02:23 -08:00
|
|
|
]
|
|
|
|
});
|
|
|
|
TestBed.compileComponents();
|
|
|
|
}));
|
2017-01-27 00:20:51 -08:00
|
|
|
|
2017-02-02 23:02:23 -08:00
|
|
|
beforeEach(() => {
|
|
|
|
fixture = TestBed.createComponent(AppComponent);
|
|
|
|
component = fixture.componentInstance;
|
|
|
|
});
|
2017-01-27 00:20:51 -08:00
|
|
|
|
2017-02-02 23:02:23 -08:00
|
|
|
it('should create', () => {
|
|
|
|
expect(component).toBeDefined();
|
|
|
|
});
|
2017-03-02 13:28:28 +00:00
|
|
|
|
|
|
|
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', () => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-02-02 23:02:23 -08:00
|
|
|
});
|