mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Fix start process test
- Failing due to bug in underlying alfesco-js-api@0.3.7 - Remove dependency on underlying lin to fix Refs #730
This commit is contained in:
parent
daec68b423
commit
97fb6cb77c
@ -30,7 +30,7 @@ declare let jasmine: any;
|
|||||||
|
|
||||||
describe('FormService', () => {
|
describe('FormService', () => {
|
||||||
|
|
||||||
let responseBody: any, service: FormService;
|
let responseBody: any, service: FormService, apiService: AlfrescoApiService;
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@ -44,6 +44,7 @@ describe('FormService', () => {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
service = TestBed.get(FormService);
|
service = TestBed.get(FormService);
|
||||||
|
apiService = TestBed.get(AlfrescoApiService);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -230,19 +231,19 @@ describe('FormService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should get start form definition by process definition id', (done) => {
|
it('should get start form definition by process definition id', (done) => {
|
||||||
responseBody = {id: 1};
|
|
||||||
|
let processApiSpy = jasmine.createSpyObj(['getProcessDefinitionStartForm']);
|
||||||
|
spyOn(apiService, 'getInstance').and.returnValue({
|
||||||
|
activiti: {
|
||||||
|
processApi: processApiSpy
|
||||||
|
}
|
||||||
|
});
|
||||||
|
processApiSpy.getProcessDefinitionStartForm.and.returnValue(Promise.resolve({ id: '1' }));
|
||||||
|
|
||||||
service.getStartFormDefinition('myprocess:1').subscribe(result => {
|
service.getStartFormDefinition('myprocess:1').subscribe(result => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/process-definitions/myprocess%3A1/start-form')).toBe(true);
|
expect(processApiSpy.getProcessDefinitionStartForm).toHaveBeenCalledWith('myprocess:1');
|
||||||
expect(result.id).toEqual(responseBody.id);
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
||||||
'status': 200,
|
|
||||||
contentType: 'application/json',
|
|
||||||
responseText: JSON.stringify(responseBody)
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not get form id from response', () => {
|
it('should not get form id from response', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user