mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
fix lint
This commit is contained in:
parent
ed333089cf
commit
a8999b77e5
@ -117,13 +117,14 @@ class BlobTestComponent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fdescribe('Test PdfViewer component', () => {
|
describe('Test PdfViewer component', () => {
|
||||||
|
|
||||||
let component: PdfViewerComponent;
|
let component: PdfViewerComponent;
|
||||||
let fixture: ComponentFixture<PdfViewerComponent>;
|
let fixture: ComponentFixture<PdfViewerComponent>;
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
let change: any;
|
let change: any;
|
||||||
let dialog: MatDialog;
|
let dialog: MatDialog;
|
||||||
|
let renderingQueueServices: RenderingQueueServices;
|
||||||
|
|
||||||
setupTestBed({
|
setupTestBed({
|
||||||
imports: [
|
imports: [
|
||||||
@ -137,7 +138,12 @@ fdescribe('Test PdfViewer component', () => {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TranslationService, useClass: TranslationMock },
|
{ provide: TranslationService, useClass: TranslationMock },
|
||||||
{ provide: MatDialog, useValue: { open: () => {} } },
|
{
|
||||||
|
provide: MatDialog, useValue: {
|
||||||
|
open: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
RenderingQueueServices
|
RenderingQueueServices
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@ -145,6 +151,7 @@ fdescribe('Test PdfViewer component', () => {
|
|||||||
beforeEach((done) => {
|
beforeEach((done) => {
|
||||||
fixture = TestBed.createComponent(PdfViewerComponent);
|
fixture = TestBed.createComponent(PdfViewerComponent);
|
||||||
dialog = TestBed.get(MatDialog);
|
dialog = TestBed.get(MatDialog);
|
||||||
|
renderingQueueServices = TestBed.get(RenderingQueueServices);
|
||||||
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
@ -429,35 +436,49 @@ fdescribe('Test PdfViewer component', () => {
|
|||||||
|
|
||||||
describe('Zoom', () => {
|
describe('Zoom', () => {
|
||||||
|
|
||||||
it('should zoom in increment the scale value', () => {
|
it('should zoom in increment the scale value', fakeAsync(() => {
|
||||||
|
spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {
|
||||||
|
});
|
||||||
|
|
||||||
let zoomInButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-in-button');
|
let zoomInButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-in-button');
|
||||||
|
|
||||||
|
tick(250);
|
||||||
|
|
||||||
let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
||||||
zoomInButton.click();
|
zoomInButton.click();
|
||||||
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
||||||
let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
||||||
expect(zoomBefore < currentZoom).toBe(true);
|
expect(zoomBefore < currentZoom).toBe(true);
|
||||||
}, 5000);
|
}));
|
||||||
|
|
||||||
it('should zoom out decrement the scale value', () => {
|
it('should zoom out decrement the scale value', fakeAsync(() => {
|
||||||
|
spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {
|
||||||
|
});
|
||||||
let zoomOutButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-out-button');
|
let zoomOutButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-out-button');
|
||||||
|
|
||||||
|
tick(250);
|
||||||
|
|
||||||
let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
||||||
zoomOutButton.click();
|
zoomOutButton.click();
|
||||||
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
||||||
let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale;
|
||||||
expect(zoomBefore > currentZoom).toBe(true);
|
expect(zoomBefore > currentZoom).toBe(true);
|
||||||
}, 5000);
|
}));
|
||||||
|
|
||||||
|
it('should it-in button toggle page-fit and auto scale mode', fakeAsync(() => {
|
||||||
|
spyOn(componentUrlTestComponent.pdfViewerComponent.pdfViewer, 'forceRendering').and.callFake(() => {
|
||||||
|
});
|
||||||
|
|
||||||
it('should it-in button toggle page-fit and auto scale mode', () => {
|
|
||||||
let itPage: any = elementUrlTestComponent.querySelector('#viewer-scale-page-button');
|
let itPage: any = elementUrlTestComponent.querySelector('#viewer-scale-page-button');
|
||||||
|
|
||||||
|
tick(250);
|
||||||
|
|
||||||
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
||||||
itPage.click();
|
itPage.click();
|
||||||
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('page-fit');
|
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('page-fit');
|
||||||
itPage.click();
|
itPage.click();
|
||||||
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto');
|
||||||
}, 5000);
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Resize interaction', () => {
|
describe('Resize interaction', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user