mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
@@ -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');
|
||||
|
@@ -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;
|
||||
|
@@ -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(() => {
|
||||
|
Reference in New Issue
Block a user