mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5426] Remove compatibility layer from Lib (#7110)
* remove compatibility step 1 * remove compatibility step 2 * remove compatibility step 3 * remove compatibility step 4 * remove compatibility step 5
This commit is contained in:
@@ -27,12 +27,28 @@ import { TabModel } from './tab.model';
|
||||
import { fakeMetadataForm, fakeViewerForm } from 'process-services-cloud/src/lib/form/mocks/cloud-form.mock';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { UploadWidgetContentLinkModel } from './upload-widget-content-link.model';
|
||||
import { AlfrescoApiService } from '../../../../services';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, setupTestBed } from '../../../../testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreModule } from '../../../../core.module';
|
||||
|
||||
describe('FormModel', () => {
|
||||
let formService: FormService;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
|
||||
formService = new FormService(null, alfrescoApiService, null);
|
||||
});
|
||||
|
||||
it('should store original json', () => {
|
||||
|
@@ -28,6 +28,7 @@ import { DropdownEditorComponent } from './dropdown.editor';
|
||||
import { setupTestBed } from '../../../../../../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../../../../../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService } from '../../../../../../services';
|
||||
|
||||
describe('DropdownEditorComponent', () => {
|
||||
|
||||
@@ -37,6 +38,7 @@ describe('DropdownEditorComponent', () => {
|
||||
let table: DynamicTableModel;
|
||||
let column: DynamicTableColumn;
|
||||
let row: DynamicTableRow;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
@@ -46,7 +48,8 @@ describe('DropdownEditorComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
formService = new FormService(null, alfrescoApiService, null);
|
||||
|
||||
row = <DynamicTableRow> {value: {dropdown: 'one'}};
|
||||
column = <DynamicTableColumn> {
|
||||
|
@@ -22,15 +22,29 @@ import { DynamicTableColumn } from './../dynamic-table-column.model';
|
||||
import { DynamicTableRow } from './../dynamic-table-row.model';
|
||||
import { DynamicTableModel } from './../dynamic-table.widget.model';
|
||||
import { RowEditorComponent } from './row.editor';
|
||||
import { AlfrescoApiService } from '../../../../../services';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, setupTestBed } from '../../../../../testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('RowEditorComponent', () => {
|
||||
|
||||
let component: RowEditorComponent;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
|
||||
component = new RowEditorComponent();
|
||||
const field = new FormFieldModel(new FormModel());
|
||||
component.table = new DynamicTableModel(field, new FormService(null, null, null));
|
||||
component.table = new DynamicTableModel(field, new FormService(null, alfrescoApiService, null));
|
||||
component.row = <DynamicTableRow> {};
|
||||
component.column = <DynamicTableColumn> {};
|
||||
});
|
||||
|
@@ -22,14 +22,28 @@ import { FormFieldModel } from '../core/form-field.model';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { GroupModel } from '../core/group.model';
|
||||
import { FunctionalGroupWidgetComponent } from './functional-group.widget';
|
||||
import { AlfrescoApiService } from '../../../../services';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, setupTestBed } from '../../../../testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('FunctionalGroupWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
let elementRef: ElementRef;
|
||||
let widget: FunctionalGroupWidgetComponent;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
|
||||
formService = new FormService(null, alfrescoApiService, null);
|
||||
elementRef = new ElementRef(null);
|
||||
widget = new FunctionalGroupWidgetComponent(formService, elementRef);
|
||||
widget.field = new FormFieldModel(new FormModel());
|
||||
|
@@ -30,11 +30,13 @@ import { MatRadioModule } from '@angular/material/radio';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { CoreTestingModule } from '../../../../testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService } from '../../../../services';
|
||||
|
||||
describe('RadioButtonsWidgetComponent', () => {
|
||||
|
||||
let formService: FormService;
|
||||
let widget: RadioButtonsWidgetComponent;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
@@ -47,7 +49,9 @@ describe('RadioButtonsWidgetComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
|
||||
formService = new FormService(null, alfrescoApiService, null);
|
||||
widget = new RadioButtonsWidgetComponent(formService, null);
|
||||
widget.field = new FormFieldModel(new FormModel(), { restUrl: '<url>' });
|
||||
});
|
||||
|
@@ -28,12 +28,14 @@ import { TypeaheadWidgetComponent } from './typeahead.widget';
|
||||
import { setupTestBed } from '../../../../testing/setup-test-bed';
|
||||
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreTestingModule } from '../../../../testing/core.testing.module';
|
||||
import { AlfrescoApiService } from '../../../../services';
|
||||
|
||||
describe('TypeaheadWidgetComponent', () => {
|
||||
|
||||
let formService: FormService;
|
||||
let widget: TypeaheadWidgetComponent;
|
||||
let translationService: TranslateService;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
@@ -43,11 +45,12 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
translationService = TestBed.inject(TranslateService);
|
||||
spyOn(translationService, 'instant').and.callFake((key) => { return key; });
|
||||
spyOn(translationService, 'get').and.callFake((key) => { return of(key); });
|
||||
|
||||
formService = new FormService(null, null, null);
|
||||
formService = new FormService(null, alfrescoApiService, null);
|
||||
widget = new TypeaheadWidgetComponent(formService, null);
|
||||
widget.field = new FormFieldModel(new FormModel({ taskId: 'task-id' }));
|
||||
widget.field.restUrl = 'whateverURL';
|
||||
|
Reference in New Issue
Block a user