mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-38312] fix start process error translation string (#11239)
This commit is contained in:
+20
@@ -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();
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user