mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
add event Keyboard test
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
import {describe, expect, it, inject } from '@angular/core/testing';
|
||||
import { TestComponentBuilder } from '@angular/compiler/testing';
|
||||
import { ViewerComponent } from './viewer.component';
|
||||
import { EventMock } from './assets/event.mock';
|
||||
|
||||
describe('ViewerComponent', () => {
|
||||
|
||||
@@ -97,6 +98,23 @@ import { ViewerComponent } from './viewer.component';
|
||||
expect(element.querySelector('#viewer-main-container')).toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
it('Esc button should hide the viewer', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
return tcb
|
||||
.createAsync(ViewerComponent)
|
||||
.then((fixture) => {
|
||||
let element = fixture.nativeElement;
|
||||
let component = fixture.componentInstance;
|
||||
component.urlFile = 'fake-url-file';
|
||||
|
||||
|
||||
|
||||
fixture.detectChanges();
|
||||
EventMock.keyDown(27);
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#viewer-main-container')).toBeNull();
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Attribute', () => {
|
||||
|
Reference in New Issue
Block a user