Fix filename shown in title area of viewer component

This commit is contained in:
Will Abson
2016-06-10 12:20:59 +01:00
parent de80f3bca9
commit f0e00e39c3
7 changed files with 32 additions and 6 deletions

View File

@@ -80,6 +80,23 @@ describe('ViewerComponent', () => {
});
}));
/* tslint:disable:max-line-length */
it('should pick up filename from the fileName property when specified', injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb
.createAsync(ViewerComponent)
.then((fixture) => {
let element = fixture.nativeElement;
let component = fixture.componentInstance;
component.urlFile = 'http://localhost:9876/fake-url-file.pdf';
component.fileName = 'My Example.pdf';
component.ngOnChanges().then(() => {
fixture.detectChanges();
expect(element.querySelector('#viewer-name-file').innerHTML).toEqual('My Example.pdf');
});
});
}));
it('Close button should be present', injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb
.createAsync(ViewerComponent)