#1215 use alfresco-js-api for upload file

This commit is contained in:
Mario Romano
2016-12-12 23:58:31 +00:00
parent ca77608fa3
commit b9b9808dd0
7 changed files with 111 additions and 105 deletions

View File

@@ -16,20 +16,18 @@
*/
import { UploadWidget } from './upload.widget';
import { AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoApiService, StorageService } from 'ng2-alfresco-core';
import { FormFieldModel } from './../core/form-field.model';
import { FormFieldTypes } from '../core/form-field-types';
import { FormService } from '../../../services/form.service';
describe('UploadWidget', () => {
let widget: UploadWidget;
let settingsService: AlfrescoSettingsService;
let authService: AlfrescoAuthenticationService;
let formService: FormService;
beforeEach(() => {
settingsService = new AlfrescoSettingsService();
authService = new AlfrescoAuthenticationService(settingsService, new AlfrescoApiService(), new StorageService());
widget = new UploadWidget(settingsService, authService);
formService = new FormService(null, null);
widget = new UploadWidget(formService);
});
it('should setup with field data', () => {
@@ -39,7 +37,7 @@ describe('UploadWidget', () => {
widget.field = new FormFieldModel(null, {
type: FormFieldTypes.UPLOAD,
value: [
{ name: encodedFileName }
{name: encodedFileName}
]
});
@@ -73,7 +71,7 @@ describe('UploadWidget', () => {
widget.field = new FormFieldModel(null, {
type: FormFieldTypes.UPLOAD,
value: [
{ name: 'filename' }
{name: 'filename'}
]
});
widget.reset();