Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,26 @@ describe('StartProcessCloudComponent', () => {
expect(errorEl.innerText.trim()).toBe('Process start failed');
});

it('should use fallback error message when no specific error message is provided', async () => {
getDefinitionsSpy.and.returnValue(of(fakeProcessDefinitions));
const change = new SimpleChange('myApp', 'myApp1', true);
component.ngOnChanges({ appName: change });
const errorWithoutMessage = {
response: {
body: {}
}
};
startProcessSpy = startProcessSpy.and.returnValue(throwError(errorWithoutMessage));
component.startProcess();

fixture.detectChanges();
await fixture.whenStable();

expect(component.errorMessageId).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START');
const errorEl = fixture.nativeElement.querySelector('#error-message');
expect(errorEl.innerText.trim()).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START');
});

it('should emit start event when start select a process and add a name', (done) => {
const disposableStart = component.success.subscribe(() => {
disposableStart.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
this.isProcessStarting = false;
},
error: (err) => {
this.errorMessageId = err?.response?.body?.message || 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START_PROCESS';
this.errorMessageId = err?.response?.body?.message || 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START';
this.error.emit(err);
this.isProcessStarting = false;
}
Expand Down
Loading