mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3610] fix pdf worker memory leak (#3843)
* fix pdf worker memory leak * test fixes * fix computed style test * fix lint
This commit is contained in:
committed by
Eugenio Romano
parent
4a9431bf10
commit
bc0865bdb9
@@ -27,6 +27,7 @@ import { setupTestBed } from '../../testing/setupTestBed';
|
||||
import { CoreModule } from '../../core.module';
|
||||
import { TranslationService } from '../../services/translation.service';
|
||||
import { TranslationMock } from '../../mock/translation.service.mock';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
declare const pdfjsLib: any;
|
||||
|
||||
@@ -201,6 +202,10 @@ describe('Test PdfViewer component', () => {
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixtureUrlTestComponent.destroy();
|
||||
});
|
||||
|
||||
it('should Canvas be present', (done) => {
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
fixtureUrlTestComponent.whenStable().then(() => {
|
||||
@@ -250,16 +255,22 @@ describe('Test PdfViewer component', () => {
|
||||
let componentBlobTestComponent: BlobTestComponent;
|
||||
let elementBlobTestComponent: HTMLElement;
|
||||
|
||||
beforeEach((done) => {
|
||||
beforeEach(done => {
|
||||
fixtureBlobTestComponent = TestBed.createComponent(BlobTestComponent);
|
||||
componentBlobTestComponent = fixtureBlobTestComponent.componentInstance;
|
||||
elementBlobTestComponent = fixtureBlobTestComponent.nativeElement;
|
||||
|
||||
fixtureBlobTestComponent.detectChanges();
|
||||
|
||||
componentBlobTestComponent.pdfViewerComponent.rendered.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
componentBlobTestComponent.pdfViewerComponent.rendered
|
||||
.pipe(take(1))
|
||||
.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixtureBlobTestComponent.destroy();
|
||||
});
|
||||
|
||||
it('should Canvas be present', async(() => {
|
||||
@@ -319,9 +330,15 @@ describe('Test PdfViewer component', () => {
|
||||
|
||||
fixtureUrlTestComponent.detectChanges();
|
||||
|
||||
componentUrlTestComponent.pdfViewerComponent.rendered.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
componentUrlTestComponent.pdfViewerComponent.rendered
|
||||
.pipe(take(1))
|
||||
.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixtureUrlTestComponent.destroy();
|
||||
});
|
||||
|
||||
it('should Total number of pages be loaded', (done) => {
|
||||
|
Reference in New Issue
Block a user