[AAE-38312] fix start process error translation string (#11239)

This commit is contained in:
Darren Thornton
2025-10-02 10:09:59 -05:00
committed by GitHub
parent dffa37f182
commit 3356dab434
2 changed files with 21 additions and 1 deletions
@@ -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();
@@ -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;
}