mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ACS-8652: Noop Translation Module for better unit testing ergonomics (#10118)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppConfigService, TranslationMock, TranslationService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { AppConfigService, NoopTranslateModule, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import {
|
||||
CategoryBody,
|
||||
CategoryEntry,
|
||||
@@ -30,8 +30,6 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { CategoryService } from './category.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('CategoryService', () => {
|
||||
let categoryService: CategoryService;
|
||||
@@ -47,8 +45,7 @@ describe('CategoryService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot()],
|
||||
providers: [CategoryService, UserPreferencesService, { provide: TranslationService, useClass: TranslationMock }]
|
||||
imports: [NoopTranslateModule]
|
||||
});
|
||||
|
||||
categoryService = TestBed.inject(CategoryService);
|
||||
|
@@ -21,14 +21,12 @@ import { Node } from '@alfresco/js-api';
|
||||
import { ContentMetadataCardComponent } from './content-metadata-card.component';
|
||||
import { ContentMetadataComponent } from '../content-metadata/content-metadata.component';
|
||||
import { APP_INITIALIZER, SimpleChange } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodeAspectService } from '../../../aspect-list/services/node-aspect.service';
|
||||
import { ContentMetadataService } from '../../services/content-metadata.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
import { of } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AuthModule, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AuthModule, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { versionCompatibilityFactory } from '../../../version-compatibility/version-compatibility-factory';
|
||||
import { VersionCompatibilityService } from '../../../version-compatibility';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
@@ -53,17 +51,15 @@ describe('ContentMetadataCardComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
NoopAnimationsModule,
|
||||
NoopTranslateModule,
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
MatDialogModule,
|
||||
MatSnackBarModule,
|
||||
ContentMetadataCardComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: versionCompatibilityFactory,
|
||||
|
@@ -26,14 +26,12 @@ import {
|
||||
AuthModule,
|
||||
CardViewBaseItemModel,
|
||||
CardViewComponent,
|
||||
NoopTranslateModule,
|
||||
NotificationService,
|
||||
TranslationMock,
|
||||
TranslationService,
|
||||
UpdateNotification
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { EMPTY, of, throwError } from 'rxjs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CardViewContentUpdateService } from '../../../common/services/card-view-content-update.service';
|
||||
import { PropertyGroup } from '../../interfaces/property-group.interface';
|
||||
import { PropertyDescriptorsService } from '../../services/property-descriptors.service';
|
||||
@@ -47,7 +45,6 @@ import {
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { MatExpansionPanel } from '@angular/material/expansion';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -184,16 +181,14 @@ describe('ContentMetadataComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
NoopAnimationsModule,
|
||||
NoopTranslateModule,
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
MatDialogModule,
|
||||
MatSnackBarModule,
|
||||
ContentMetadataComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{
|
||||
provide: TagService,
|
||||
useValue: {
|
||||
|
@@ -21,12 +21,9 @@ import { Subject } from 'rxjs';
|
||||
import { Category } from '@alfresco/js-api';
|
||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfigService, AppConfigServiceMock, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { CategoriesManagementComponent } from '../../category';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { AppConfigService, AppConfigServiceMock, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('Category selector dialog component', () => {
|
||||
describe('CategorySelectorDialogComponent', () => {
|
||||
let fixture: ComponentFixture<CategorySelectorDialogComponent>;
|
||||
let component: CategorySelectorDialogComponent;
|
||||
let selectButton: HTMLButtonElement;
|
||||
@@ -51,18 +48,11 @@ describe('Category selector dialog component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
MatDialogModule,
|
||||
HttpClientTestingModule,
|
||||
CategoriesManagementComponent,
|
||||
CategorySelectorDialogComponent
|
||||
],
|
||||
imports: [NoopTranslateModule, MatDialogModule, CategorySelectorDialogComponent],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: options },
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
{ provide: MAT_DIALOG_DATA, useValue: options }
|
||||
]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
|
@@ -21,9 +21,7 @@ import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { DownloadEntry, FileDownloadStatus } from '@alfresco/js-api';
|
||||
import { EMPTY, Observable, of } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, RedirectAuthService, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, NoopTranslateModule, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
describe('DownloadZipDialogComponent', () => {
|
||||
@@ -41,11 +39,10 @@ describe('DownloadZipDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot(), MatDialogModule, NoopAnimationsModule],
|
||||
imports: [NoopTranslateModule, MatDialogModule, NoopAnimationsModule],
|
||||
providers: [
|
||||
DownloadZipService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: dataMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
|
@@ -19,7 +19,7 @@ import { Component } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { AutoFocusDirective } from './auto-focus.directive';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -33,7 +33,7 @@ describe('AutoFocusDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), AutoFocusDirective, AutoFocusTestComponent]
|
||||
imports: [NoopTranslateModule, AutoFocusDirective, AutoFocusTestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AutoFocusTestComponent);
|
||||
});
|
||||
|
@@ -19,7 +19,7 @@ import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NodeCounterDirective, NodeCounterComponent } from './node-counter.directive';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -35,7 +35,7 @@ describe('NodeCounterDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), NodeCounterDirective, NodeCounterComponent, TestComponent]
|
||||
imports: [NoopTranslateModule, NodeCounterDirective, NodeCounterComponent, TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixture.detectChanges();
|
||||
|
@@ -19,9 +19,7 @@ import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeDeleteDirective } from './node-delete.directive';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { RedirectAuthService, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { NoopTranslateModule, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
|
||||
|
||||
@@ -85,11 +83,8 @@ describe('NodeDeleteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot(), TestComponent, TestWithPermissionsComponent, TestDeletePermanentComponent],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
]
|
||||
imports: [NoopTranslateModule, TestComponent, TestWithPermissionsComponent, TestDeletePermanentComponent],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixtureWithPermissions = TestBed.createComponent(TestWithPermissionsComponent);
|
||||
|
@@ -19,9 +19,7 @@ import { Component, DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeRestoreDirective } from './node-restore.directive';
|
||||
import { TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NoopTranslateModule, TranslationService } from '@alfresco/adf-core';
|
||||
import { TrashcanApi } from '@alfresco/js-api';
|
||||
|
||||
@Component({
|
||||
@@ -46,8 +44,7 @@ describe('NodeRestoreDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot(), TestComponent],
|
||||
providers: [{ provide: TranslationService, useClass: TranslationMock }]
|
||||
imports: [NoopTranslateModule, TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -20,11 +20,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FileAutoDownloadComponent } from './file-auto-download.component';
|
||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { NodeDownloadDirective } from '../../../directives/node-download.directive';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
const mockDialog = {
|
||||
close: jasmine.createSpy('close')
|
||||
@@ -37,18 +35,10 @@ describe('FileAutoDownloadComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
MatDialogModule,
|
||||
MatButtonModule,
|
||||
NodeDownloadDirective,
|
||||
FileAutoDownloadComponent
|
||||
],
|
||||
imports: [NoopTranslateModule, MatDialogModule, MatButtonModule, NodeDownloadDirective, FileAutoDownloadComponent],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: mockDialog },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: null },
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
{ provide: MAT_DIALOG_DATA, useValue: null }
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -21,8 +21,7 @@ import { fakeAuthorityClearanceApiResponse } from './mock/security-authorities.m
|
||||
import { fakeGroupsApiResponse, createNewSecurityGroupMock } from './mock/security-groups.mock';
|
||||
import { fakeMarksApiResponse, createNewSecurityMarkMock } from './mock/security-marks.mock';
|
||||
import { SecurityGroupBody, SecurityMarkBody, SecurityMarkEntry } from '@alfresco/js-api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('SecurityControlsService', () => {
|
||||
let service: SecurityControlsService;
|
||||
@@ -39,7 +38,7 @@ describe('SecurityControlsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule]
|
||||
imports: [NoopTranslateModule]
|
||||
});
|
||||
|
||||
service = TestBed.inject(SecurityControlsService);
|
||||
|
@@ -17,9 +17,8 @@
|
||||
|
||||
import { ComponentFixture, discardPeriodicTasks, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
|
||||
import { TagsCreatorComponent } from './tags-creator.component';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { NoopTranslateModule, NotificationService } from '@alfresco/adf-core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatError } from '@angular/material/form-field';
|
||||
import { TagsCreatorMode, TagService } from '@alfresco/adf-content-services';
|
||||
import { EMPTY, of, throwError } from 'rxjs';
|
||||
@@ -39,7 +38,7 @@ describe('TagsCreatorComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), TagsCreatorComponent],
|
||||
imports: [NoopAnimationsModule, NoopTranslateModule, TagsCreatorComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: TagService,
|
||||
|
@@ -22,16 +22,14 @@ import {
|
||||
CoreModule,
|
||||
AlfrescoApiService,
|
||||
AppConfigService,
|
||||
TranslationService,
|
||||
CookieService,
|
||||
AlfrescoApiServiceMock,
|
||||
AppConfigServiceMock,
|
||||
TranslationMock,
|
||||
CookieServiceMock,
|
||||
AuthModule
|
||||
AuthModule,
|
||||
NoopTranslateModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentModule } from '../content.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { versionCompatibilityFactory } from '../version-compatibility/version-compatibility-factory';
|
||||
import { VersionCompatibilityService } from '../version-compatibility/version-compatibility.service';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
@@ -41,15 +39,14 @@ import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule,
|
||||
NoopTranslateModule,
|
||||
ContentModule,
|
||||
MatIconTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
@@ -58,6 +55,6 @@ import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
multi: true
|
||||
}
|
||||
],
|
||||
exports: [NoopAnimationsModule, TranslateModule, CoreModule, ContentModule]
|
||||
exports: [NoopAnimationsModule, CoreModule, ContentModule]
|
||||
})
|
||||
export class ContentTestingModule {}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TreeComponent } from './tree.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContextMenuDirective, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ContextMenuDirective, NoopTranslateModule, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { TreeNode, TreeNodeType } from '../models/tree-node.interface';
|
||||
import { singleNode, treeNodesChildrenMockExpanded, treeNodesMock, treeNodesMockExpanded, treeNodesNoChildrenMock } from '../mock/tree-node.mock';
|
||||
import { of, Subject } from 'rxjs';
|
||||
@@ -30,8 +30,6 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
describe('TreeComponent', () => {
|
||||
@@ -64,7 +62,7 @@ describe('TreeComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, HttpClientTestingModule, TranslateModule.forRoot(), TreeComponent],
|
||||
imports: [NoopAnimationsModule, NoopTranslateModule, TreeComponent],
|
||||
providers: [UserPreferencesService, { provide: TreeService, useClass: TreeServiceMock }]
|
||||
});
|
||||
|
||||
|
@@ -15,15 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { TranslationMock } from '@alfresco/adf-core';
|
||||
import { NoopTranslationService } from '@alfresco/adf-core';
|
||||
import { FileUploadErrorPipe } from './file-upload-error.pipe';
|
||||
|
||||
describe('FileUploadErrorPipe', () => {
|
||||
|
||||
let pipe: FileUploadErrorPipe;
|
||||
|
||||
beforeEach(() => {
|
||||
pipe = new FileUploadErrorPipe(new TranslationMock());
|
||||
pipe = new FileUploadErrorPipe(new NoopTranslationService());
|
||||
});
|
||||
|
||||
it('should return generic message when error code is null', () => {
|
||||
|
@@ -20,8 +20,6 @@ import { SpyLocation } from '@angular/common/testing';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { ContentInfo, Node, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoViewerComponent, ContentService, NodeActionsService, RenditionService } from '@alfresco/adf-content-services';
|
||||
import {
|
||||
@@ -30,12 +28,11 @@ import {
|
||||
AuthModule,
|
||||
CloseButtonPosition,
|
||||
EventMock,
|
||||
TranslationMock,
|
||||
TranslationService,
|
||||
ViewUtilService,
|
||||
ViewerComponent,
|
||||
VIEWER_DIRECTIVES,
|
||||
ViewerSidebarComponent
|
||||
ViewerSidebarComponent,
|
||||
NoopTranslateModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { UploadService } from '../../common/services/upload.service';
|
||||
@@ -44,8 +41,6 @@ import { throwError } from 'rxjs';
|
||||
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ESCAPE } from '@angular/cdk/keycodes';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-container-toolbar',
|
||||
@@ -100,7 +95,7 @@ class DummyDialogComponent {}
|
||||
<mat-icon>dialpad</mat-icon>
|
||||
<span>Option 1</span>
|
||||
</button>
|
||||
<button mat-menu-item disabled>
|
||||
<button mat-menu-item [disabled]="true">
|
||||
<mat-icon>voicemail</mat-icon>
|
||||
<span>Option 2</span>
|
||||
</button>
|
||||
@@ -123,7 +118,7 @@ class ViewerWithCustomOpenWithComponent {}
|
||||
<mat-icon>dialpad</mat-icon>
|
||||
<span>Action One</span>
|
||||
</button>
|
||||
<button mat-menu-item disabled>
|
||||
<button mat-menu-item [disabled]="true">
|
||||
<mat-icon>voicemail</mat-icon>
|
||||
<span>Action Two</span>
|
||||
</button>
|
||||
@@ -152,15 +147,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
TranslateModule.forRoot(),
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatDialogModule,
|
||||
HttpClientTestingModule,
|
||||
...VIEWER_DIRECTIVES
|
||||
],
|
||||
imports: [AuthModule.forRoot({ useHash: true }), MatDialogModule, NoopTranslateModule, ...VIEWER_DIRECTIVES],
|
||||
declarations: [
|
||||
ViewerWithCustomToolbarComponent,
|
||||
ViewerWithCustomSidebarComponent,
|
||||
@@ -171,7 +158,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
providers: [
|
||||
ContentService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{
|
||||
provide: RenditionService,
|
||||
useValue: {
|
||||
|
Reference in New Issue
Block a user