prepare tests for ng-12 upgrade (#7099)

* prepare tests for ng12 upgrade

* fix lint

* fix tests

* test fixes

* fix code and tests

* fix code and tests

* test fixes

* test fixes
This commit is contained in:
Denys Vuika
2021-06-11 07:36:32 +01:00
committed by GitHub
parent 558056b05c
commit eb71a79d1e
112 changed files with 982 additions and 1057 deletions

View File

@@ -129,7 +129,7 @@ describe('RadioButtonsWidgetComponent', () => {
});
it('should update the field value when an option is selected', () => {
spyOn(widget, 'onFieldChanged').and.returnValue(of({}));
spyOn(widget, 'onFieldChanged').and.stub();
widget.onOptionClick('fake-opt');
expect(widget.field.value).toEqual('fake-opt');

View File

@@ -28,8 +28,9 @@ import { UploadWidgetComponent } from './upload.widget';
import { setupTestBed } from '../../../../testing/setup-test-bed';
import { CoreTestingModule } from '../../../../testing/core.testing.module';
import { TranslateModule } from '@ngx-translate/core';
import { RelatedContentRepresentation } from '@alfresco/js-api';
const fakePngAnswer = {
const fakePngAnswer = new RelatedContentRepresentation({
'id': 1155,
'name': 'a_png_file.png',
'created': '2017-07-25T17:17:37.099Z',
@@ -41,7 +42,7 @@ const fakePngAnswer = {
'simpleType': 'image',
'previewStatus': 'queued',
'thumbnailStatus': 'queued'
};
});
const fakeJpgAnswer = {
'id': 1156,
@@ -211,7 +212,7 @@ describe('UploadWidgetComponent', () => {
return of(fakeJpgAnswer);
}
return of();
return of(null);
});
uploadWidgetComponent.field.params.multiple = true;
@@ -241,7 +242,7 @@ describe('UploadWidgetComponent', () => {
return of(fakeJpgAnswer);
}
return of();
return of(null);
});
uploadWidgetComponent.field.params.multiple = true;

View File

@@ -233,7 +233,7 @@ describe('Form service', () => {
activiti: {
processApi: processApiSpy
}
});
} as any);
processApiSpy.getProcessDefinitionStartForm.and.returnValue(Promise.resolve({ id: '1' }));
service.getStartFormDefinition('myprocess:1').subscribe(() => {