mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
AAE-34298 fix tests
This commit is contained in:
@@ -19,7 +19,7 @@ import 'zone.js';
|
|||||||
import 'zone.js/testing';
|
import 'zone.js/testing';
|
||||||
import { getTestBed } from '@angular/core/testing';
|
import { getTestBed } from '@angular/core/testing';
|
||||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||||
import pdfjsLibMock from './src/lib/viewer/components/mock/pdfjs-lib.mock';
|
import pdfjsLibMock from './viewer/src/components/mock/pdfjs-lib.mock';
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"lib": {
|
"lib": {
|
||||||
"entryFile": "src/index.ts",
|
"entryFile": "src/index.ts",
|
||||||
"styleIncludePaths": [
|
"styleIncludePaths": [
|
||||||
"../src/lib/styles"
|
"../src/lib"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MatDialogRef } from '@angular/material/dialog';
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
import { CoreTestingModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||||
import { DownloadPromptActions } from '../../models/download-prompt.actions';
|
import { DownloadPromptActions } from '../../models/download-prompt.actions';
|
||||||
import { DownloadPromptDialogComponent } from './download-prompt-dialog.component';
|
import { DownloadPromptDialogComponent } from './download-prompt-dialog.component';
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
@use 'mat-selectors' as ms;
|
@use 'styles/mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-image-viewer {
|
.adf-image-viewer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@@ -17,9 +17,7 @@
|
|||||||
|
|
||||||
import { SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||||
import { AppConfigService } from '../../../app-config';
|
import { AppConfigService, UrlService, CoreTestingModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||||
import { UrlService } from '../../../common';
|
|
||||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
|
||||||
import { ImgViewerComponent } from './img-viewer.component';
|
import { ImgViewerComponent } from './img-viewer.component';
|
||||||
|
|
||||||
describe('Test Img viewer component ', () => {
|
describe('Test Img viewer component ', () => {
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { CoreTestingModule } from '../../../testing';
|
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||||
import { PdfPasswordDialogComponent } from './pdf-viewer-password-dialog';
|
import { PdfPasswordDialogComponent } from './pdf-viewer-password-dialog';
|
||||||
|
|
||||||
declare const pdfjsLib: any;
|
declare const pdfjsLib: any;
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { PdfThumbComponent } from './pdf-viewer-thumb.component';
|
import { PdfThumbComponent } from './pdf-viewer-thumb.component';
|
||||||
import { CoreTestingModule } from '../../../testing';
|
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||||
|
|
||||||
describe('PdfThumbComponent', () => {
|
describe('PdfThumbComponent', () => {
|
||||||
let fixture: ComponentFixture<PdfThumbComponent>;
|
let fixture: ComponentFixture<PdfThumbComponent>;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { PdfThumbListComponent } from './pdf-viewer-thumbnails.component';
|
import { PdfThumbListComponent } from './pdf-viewer-thumbnails.component';
|
||||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
import { CoreTestingModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||||
import { DOWN_ARROW, ESCAPE, UP_ARROW } from '@angular/cdk/keycodes';
|
import { DOWN_ARROW, ESCAPE, UP_ARROW } from '@angular/cdk/keycodes';
|
||||||
|
|
||||||
declare const pdfjsViewer: any;
|
declare const pdfjsViewer: any;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
@use 'mat-selectors' as ms;
|
@use 'styles/mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-pdf-viewer {
|
.adf-pdf-viewer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@@ -21,13 +21,11 @@ import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { AppConfigService } from '../../../app-config';
|
|
||||||
import { EventMock } from '../../../mock';
|
|
||||||
import { NoopAuthModule, NoopTranslateModule, UnitTestingUtils } from '../../../testing';
|
|
||||||
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
||||||
import { PdfThumbListComponent } from '../pdf-viewer-thumbnails/pdf-viewer-thumbnails.component';
|
import { PdfThumbListComponent } from '../pdf-viewer-thumbnails/pdf-viewer-thumbnails.component';
|
||||||
import { PDFJS_MODULE, PDFJS_VIEWER_MODULE, PdfViewerComponent } from './pdf-viewer.component';
|
import { PDFJS_MODULE, PDFJS_VIEWER_MODULE, PdfViewerComponent } from './pdf-viewer.component';
|
||||||
import pdfjsLibMock from '../mock/pdfjs-lib.mock';
|
import pdfjsLibMock from '../mock/pdfjs-lib.mock';
|
||||||
|
import { UnitTestingUtils, NoopAuthModule, NoopTranslateModule, AppConfigService, EventMock } from '@alfresco/adf-core';
|
||||||
|
|
||||||
declare const pdfjsLib: any;
|
declare const pdfjsLib: any;
|
||||||
|
|
||||||
|
@@ -21,11 +21,14 @@ import { SpyLocation } from '@angular/common/testing';
|
|||||||
import { Component, DebugElement, TemplateRef, ViewChild } from '@angular/core';
|
import { Component, DebugElement, TemplateRef, ViewChild } from '@angular/core';
|
||||||
import { ComponentFixture, DeferBlockBehavior, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, DeferBlockBehavior, TestBed } from '@angular/core/testing';
|
||||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||||
import { NoopTranslateModule, UnitTestingUtils } from '../../../testing';
|
|
||||||
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
||||||
import { ViewerRenderComponent } from './viewer-render.component';
|
import { ViewerRenderComponent } from './viewer-render.component';
|
||||||
import { ImgViewerComponent, MediaPlayerComponent, PdfViewerComponent, ViewerExtensionDirective } from '@alfresco/adf-core';
|
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { ViewerExtensionDirective } from '../../directives/viewer-extension.directive';
|
||||||
|
import { NoopTranslateModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||||
|
import { PdfViewerComponent } from '../pdf-viewer/pdf-viewer.component';
|
||||||
|
import { ImgViewerComponent } from '../img-viewer/img-viewer.component';
|
||||||
|
import { MediaPlayerComponent } from '../media-player/media-player.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-double-viewer',
|
selector: 'adf-double-viewer',
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/* stylelint-disable scss/at-extend-no-missing-placeholder */
|
/* stylelint-disable scss/at-extend-no-missing-placeholder */
|
||||||
@use 'mat-selectors' as ms;
|
@use 'styles/mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-full-screen {
|
.adf-full-screen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
@media screen and (width <= 1450px) {
|
@media screen and (width <=1450px) {
|
||||||
left: 30%;
|
left: 30%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,9 +21,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { AppConfigService } from '../../app-config';
|
import { AppConfigService, EventMock, CoreTestingModule, UnitTestingUtils, ThumbnailService } from '@alfresco/adf-core';
|
||||||
import { EventMock } from '../../mock';
|
|
||||||
import { CoreTestingModule, UnitTestingUtils } from '../../testing';
|
|
||||||
import { DownloadPromptActions } from '../models/download-prompt.actions';
|
import { DownloadPromptActions } from '../models/download-prompt.actions';
|
||||||
import { CloseButtonPosition } from '../models/viewer.model';
|
import { CloseButtonPosition } from '../models/viewer.model';
|
||||||
import { ViewUtilService } from '../services/view-util.service';
|
import { ViewUtilService } from '../services/view-util.service';
|
||||||
@@ -34,7 +32,6 @@ import { ViewerWithCustomSidebarComponent } from './mock/adf-viewer-container-si
|
|||||||
import { ViewerWithCustomToolbarActionsComponent } from './mock/adf-viewer-container-toolbar-actions.component.mock';
|
import { ViewerWithCustomToolbarActionsComponent } from './mock/adf-viewer-container-toolbar-actions.component.mock';
|
||||||
import { ViewerWithCustomToolbarComponent } from './mock/adf-viewer-container-toolbar.component.mock';
|
import { ViewerWithCustomToolbarComponent } from './mock/adf-viewer-container-toolbar.component.mock';
|
||||||
import { ViewerComponent } from './viewer.component';
|
import { ViewerComponent } from './viewer.component';
|
||||||
import { ThumbnailService } from '../../common/services/thumbnail.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-dialog-dummy',
|
selector: 'adf-dialog-dummy',
|
||||||
|
@@ -21,7 +21,7 @@ import { ChangeDetectorRef, ElementRef } from '@angular/core';
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { ViewerRenderComponent } from '../components/viewer-render/viewer-render.component';
|
import { ViewerRenderComponent } from '../components/viewer-render/viewer-render.component';
|
||||||
import { ViewerExtensionDirective } from './viewer-extension.directive';
|
import { ViewerExtensionDirective } from './viewer-extension.directive';
|
||||||
import { CoreTestingModule } from '../../testing';
|
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||||
|
|
||||||
describe('ExtensionViewerDirective', () => {
|
describe('ExtensionViewerDirective', () => {
|
||||||
let extensionViewerDirective: ViewerExtensionDirective;
|
let extensionViewerDirective: ViewerExtensionDirective;
|
||||||
|
@@ -35,6 +35,8 @@ export * from './components/viewer-render/viewer-render.component';
|
|||||||
export * from './components/viewer.component';
|
export * from './components/viewer.component';
|
||||||
export * from './components/download-prompt-dialog/download-prompt-dialog.component';
|
export * from './components/download-prompt-dialog/download-prompt-dialog.component';
|
||||||
|
|
||||||
|
export * from './widgets/base-viewer/base-viewer.widget';
|
||||||
|
|
||||||
export * from './directives/viewer-extension.directive';
|
export * from './directives/viewer-extension.directive';
|
||||||
|
|
||||||
export * from './viewer.module';
|
export * from './viewer.module';
|
||||||
|
Reference in New Issue
Block a user