Skip to content

Commit 3356dab

Browse files
[AAE-38312] fix start process error translation string (#11239)
1 parent dffa37f commit 3356dab

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,26 @@ describe('StartProcessCloudComponent', () => {
914914
expect(errorEl.innerText.trim()).toBe('Process start failed');
915915
});
916916

917+
it('should use fallback error message when no specific error message is provided', async () => {
918+
getDefinitionsSpy.and.returnValue(of(fakeProcessDefinitions));
919+
const change = new SimpleChange('myApp', 'myApp1', true);
920+
component.ngOnChanges({ appName: change });
921+
const errorWithoutMessage = {
922+
response: {
923+
body: {}
924+
}
925+
};
926+
startProcessSpy = startProcessSpy.and.returnValue(throwError(errorWithoutMessage));
927+
component.startProcess();
928+
929+
fixture.detectChanges();
930+
await fixture.whenStable();
931+
932+
expect(component.errorMessageId).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START');
933+
const errorEl = fixture.nativeElement.querySelector('#error-message');
934+
expect(errorEl.innerText.trim()).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START');
935+
});
936+
917937
it('should emit start event when start select a process and add a name', (done) => {
918938
const disposableStart = component.success.subscribe(() => {
919939
disposableStart.unsubscribe();

lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
476476
this.isProcessStarting = false;
477477
},
478478
error: (err) => {
479-
this.errorMessageId = err?.response?.body?.message || 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START_PROCESS';
479+
this.errorMessageId = err?.response?.body?.message || 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START';
480480
this.error.emit(err);
481481
this.isProcessStarting = false;
482482
}

0 commit comments

Comments
 (0)