[ADF-2240] fix e2e and test in demo shell (#3035)

* fix e2e and test in demo shell

* test single run demo shell conf

* fix script e2e

* fix test lint problems

* remove async from nested test

* fix pdf test

* modify url load pdf strategy test

* SimpleChange import

* pdf viewer test fix

* remove force closing

* refactor pdf viewer
-remove promise approach
-add event rendered
-add destroy worker

* increment timeout

* use proxy files

* remove require

* fix viewer component test

* remove last require

* prefer use of done for txt viewer test
This commit is contained in:
Eugenio Romano
2018-03-09 12:16:05 +00:00
committed by GitHub
parent 606009cac2
commit ae489f6737
21 changed files with 566 additions and 503 deletions

View File

@@ -127,8 +127,6 @@ class ViewerWithCustomOpenWithComponent {}
})
class ViewerWithCustomMoreActionsComponent {}
declare var require: any;
describe('ViewerComponent', () => {
let component: ViewerComponent;
@@ -593,7 +591,7 @@ describe('ViewerComponent', () => {
}));
it('should extension file txt be loaded', async(() => {
component.urlFile = require('../assets/fake-test-file.txt');
component.urlFile = 'fake-test-file.txt';
component.ngOnChanges(null);
fixture.detectChanges();
@@ -678,18 +676,18 @@ describe('ViewerComponent', () => {
});
}));
it('should display the txt viewer if the file identified by mimetype is a txt when the filename has wrong extension', async(() => {
it('should display the txt viewer if the file identified by mimetype is a txt when the filename has wrong extension', (done) => {
component.urlFile = 'content.bin';
component.mimeType = 'text/plain';
component.urlFile = require('../assets/fake-test-file.txt');
fixture.detectChanges();
component.ngOnChanges(null);
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(element.querySelector('adf-txt-viewer')).not.toBeNull();
done();
});
}));
});
it('should display the media player if the file identified by mimetype is a media when the filename has no extension', async(() => {
component.urlFile = 'content';