mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
angular cli
This commit is contained in:
23
src/app/shared/mocks/form-service.mock.ts
Normal file
23
src/app/shared/mocks/form-service.mock.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
});
|
||||
|
||||
}
|
Reference in New Issue
Block a user