mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5158] ECM Version Directive (#5779)
* [ADF-5158] ECM Version Directive * Update version-compatibility.directive.ts * Update version-compatibility.directive.ts * Change name from ecm to acs * Fix unit tests * Update docs for Version directive * Fix unit tests * Fix unit tests * Linting * Update apps-process-cloud.service.spec.ts * Fix Ecm Service initialization * Fix unit test Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { throwError } from 'rxjs';
|
||||
import { setupTestBed, CoreModule, AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { setupTestBed, AppConfigService, AlfrescoApiService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { AppsProcessCloudService } from './apps-process-cloud.service';
|
||||
import { fakeApplicationInstance } from '../mock/app-model.mock';
|
||||
@@ -40,7 +40,7 @@ describe('AppsProcessCloudService', () => {
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ProcessServiceCloudTestingModule
|
||||
]
|
||||
});
|
||||
|
@@ -29,7 +29,8 @@ import {
|
||||
FormOutcomeModel,
|
||||
setupTestBed,
|
||||
TRANSLATION_PROVIDER,
|
||||
WidgetVisibilityService
|
||||
WidgetVisibilityService,
|
||||
VersionCompatibilityService
|
||||
} from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { FormCloudService } from '../services/form-cloud.service';
|
||||
@@ -68,7 +69,7 @@ describe('FormCloudComponent', () => {
|
||||
exports: [CustomWidget],
|
||||
entryComponents: [CustomWidget]
|
||||
})
|
||||
class CustomUploadModule {}
|
||||
class CustomUploadModule { }
|
||||
|
||||
function buildWidget(type: string, injector: Injector): any {
|
||||
const resolver = formRenderingService.getComponentTypeResolver(type);
|
||||
@@ -97,6 +98,10 @@ describe('FormCloudComponent', () => {
|
||||
name: 'app',
|
||||
source: 'resources'
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: VersionCompatibilityService,
|
||||
useValue: {}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -116,7 +121,7 @@ describe('FormCloudComponent', () => {
|
||||
fixture = TestBed.createComponent(FormCloudComponent);
|
||||
formComponent = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
}));
|
||||
|
||||
it('should register custom [upload] widget', () => {
|
||||
const widget = buildWidget('upload', fixture.componentRef.injector);
|
||||
@@ -190,7 +195,7 @@ describe('FormCloudComponent', () => {
|
||||
|
||||
expect(formComponent.showTitle).toBeTruthy();
|
||||
expect(formComponent.isTitleEnabled()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not allow title if showTitle is false', () => {
|
||||
const formModel = new FormModel();
|
||||
@@ -370,7 +375,7 @@ describe('FormCloudComponent', () => {
|
||||
spyOn(formCloudService, 'getTaskForm').and.returnValue(of(cloudFormMock));
|
||||
spyOn(formCloudService, 'getTaskVariables').and.returnValue(of([]));
|
||||
spyOn(formCloudService, 'getProcessStorageFolderTask')
|
||||
.and.returnValue( of({nodeId : '123', path: '/a/path/type', type: 'fakeType'}));
|
||||
.and.returnValue(of({ nodeId: '123', path: '/a/path/type', type: 'fakeType' }));
|
||||
const taskId = '<task id>';
|
||||
const appName = 'test-app';
|
||||
formComponent.appName = appName;
|
||||
@@ -389,7 +394,7 @@ describe('FormCloudComponent', () => {
|
||||
spyOn(formCloudService, 'getTaskForm').and.returnValue(of(cloudFormMock));
|
||||
spyOn(formCloudService, 'getTaskVariables').and.returnValue(of([]));
|
||||
spyOn(formCloudService, 'getProcessStorageFolderTask')
|
||||
.and.returnValue( of({nodeId : '123', path: '/a/path/type', type: 'fakeType'}));
|
||||
.and.returnValue(of({ nodeId: '123', path: '/a/path/type', type: 'fakeType' }));
|
||||
const taskId = '<task id>';
|
||||
const processInstanceId = 'i-am-the-process-instance-id';
|
||||
const appName = 'test-app';
|
||||
@@ -947,7 +952,7 @@ describe('FormCloudComponent', () => {
|
||||
});
|
||||
|
||||
formComponent.ngOnChanges({ 'data': change });
|
||||
});
|
||||
});
|
||||
|
||||
it('should refresh radio buttons value when id is given to data', () => {
|
||||
formComponent.form = new FormModel(JSON.parse(JSON.stringify(cloudFormMock)));
|
||||
@@ -990,7 +995,7 @@ describe('FormCloudComponent', () => {
|
||||
});
|
||||
|
||||
describe('Multilingual Form', () => {
|
||||
it('should translate form labels on language change', async () => {
|
||||
it('should translate form labels on language change', async () => {
|
||||
spyOn(formCloudService, 'getForm').and.returnValue(of(multilingualForm));
|
||||
const formId = '123';
|
||||
const appName = 'test-app';
|
||||
|
@@ -27,7 +27,7 @@ import {
|
||||
IdentityGroupService,
|
||||
mockIdentityGroups,
|
||||
AlfrescoApiService,
|
||||
CoreModule
|
||||
CoreTestingModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -53,7 +53,7 @@ describe('GroupCloudComponent', () => {
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ProcessServiceCloudTestingModule,
|
||||
GroupCloudModule
|
||||
]
|
||||
|
@@ -20,9 +20,9 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import {
|
||||
IdentityUserService,
|
||||
AlfrescoApiService,
|
||||
CoreModule,
|
||||
setupTestBed,
|
||||
IdentityUserModel
|
||||
IdentityUserModel,
|
||||
CoreTestingModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
@@ -58,7 +58,7 @@ describe('PeopleCloudComponent', () => {
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ProcessServiceCloudTestingModule,
|
||||
PeopleCloudModule
|
||||
]
|
||||
|
Reference in New Issue
Block a user