mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
26 lines
740 B
TypeScript
26 lines
740 B
TypeScript
import { of as observableOf } from 'rxjs';
|
|
|
|
import { FormService } from '../form/form.service';
|
|
|
|
/**
|
|
* Mock for [[FormService]]
|
|
*/
|
|
export function getMockFormService(
|
|
id$: string = 'random_id'
|
|
): FormService {
|
|
return jasmine.createSpyObj('FormService', {
|
|
getFormData: jasmine.createSpy('getFormData'),
|
|
initForm: jasmine.createSpy('initForm'),
|
|
removeForm: jasmine.createSpy('removeForm'),
|
|
getForm: observableOf({}),
|
|
getUniqueId: id$,
|
|
resetForm: {},
|
|
validateAllFormFields: jasmine.createSpy('validateAllFormFields'),
|
|
isValid: jasmine.createSpy('isValid'),
|
|
isFormInitialized: observableOf(true),
|
|
addError: jasmine.createSpy('addError'),
|
|
removeError: jasmine.createSpy('removeError'),
|
|
});
|
|
|
|
}
|