mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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';
|
||||
|
Reference in New Issue
Block a user