Reload processlist after starting new process

Refs #1036
This commit is contained in:
Will Abson
2016-11-10 15:52:23 +00:00
parent 3c7817a44e
commit 4f22a4da14
5 changed files with 43 additions and 12 deletions

View File

@@ -37,6 +37,11 @@ describe('ActivitiStartProcessButton', () => {
let startProcessSpy: jasmine.Spy;
let debugElement: DebugElement;
let newProcess = {
id: '32323',
name: 'Process'
};
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ CoreModule, ActivitiFormModule ],
@@ -66,10 +71,7 @@ describe('ActivitiStartProcessButton', () => {
id: 'my:process2',
name: 'My Process 2'
}]));
startProcessSpy = spyOn(processService, 'startProcess').and.returnValue(Observable.of({
id: '32323',
name: 'Process'
}));
startProcessSpy = spyOn(processService, 'startProcess').and.returnValue(Observable.of(newProcess));
componentHandler = jasmine.createSpyObj('componentHandler', [
'upgradeAllRegistered',
@@ -128,6 +130,19 @@ describe('ActivitiStartProcessButton', () => {
});
});
it('should output start event when process started successfully', (done) => {
let emitSpy = spyOn(component.start, 'emit');
component.name = 'My new process';
component.processDefinitionId = 'my:process1';
component.showDialog();
fixture.detectChanges();
component.startProcess();
fixture.whenStable().then(() => {
expect(emitSpy).toHaveBeenCalledWith(newProcess);
done();
});
});
it('should indicate start form is missing when process does not have a start form', (done) => {
component.name = 'My new process';
component.processDefinitionId = 'my:process1';