fixed issue with hostwindowservice, search filter bug, changed sidebar toggle text to pin, fixed mobile view of header

This commit is contained in:
lotte
2018-12-17 12:08:12 +01:00
parent dceb835e53
commit cc53dda46b
13 changed files with 64 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
@@ -117,25 +117,26 @@ describe('AdminSidebarComponent', () => {
});
describe('when the the mouse enters the nav tag', () => {
beforeEach(() => {
it('should call expandPreview on the menuService after 100ms', fakeAsync(() => {
spyOn(menuService, 'expandMenuPreview');
const sidebarToggler = fixture.debugElement.query(By.css('nav.navbar'));
sidebarToggler.triggerEventHandler('mouseenter', {preventDefault: () => {/**/}});
});
it('should call expandPreview on the menuService', () => {
tick(99);
expect(menuService.expandMenuPreview).not.toHaveBeenCalled();
tick(1);
expect(menuService.expandMenuPreview).toHaveBeenCalled();
});
}));
});
describe('when the the mouse leaves the nav tag', () => {
beforeEach(() => {
it('should call collapseMenuPreview on the menuService after 400ms', fakeAsync(() => {
spyOn(menuService, 'collapseMenuPreview');
const sidebarToggler = fixture.debugElement.query(By.css('nav.navbar'));
sidebarToggler.triggerEventHandler('mouseleave', {preventDefault: () => {/**/}});
});
it('should call collapseMenuPreview on the menuService', () => {
tick(399);
expect(menuService.collapseMenuPreview).not.toHaveBeenCalled();
tick(1);
expect(menuService.collapseMenuPreview).toHaveBeenCalled();
});
}));
});
});