Revert "AAE-30882 Replace superagent (#11134)" (#11210)

* Revert "AAE-30882 Replace superagent (#11134)"

This reverts commit a347b20f20.

* AAE-0000 - Fixed lock for cli and adf
This commit is contained in:
Vito Albano
2025-09-19 12:44:06 +01:00
committed by GitHub
parent ef29bafc75
commit 91d6b80965
57 changed files with 3074 additions and 1051 deletions

View File

@@ -395,37 +395,24 @@ describe('AnalyticsReportParametersComponent', () => {
beforeEach(async () => {
const reportId = 1;
const change = new SimpleChange(null, reportId, true);
component.ngOnChanges({ reportId: change });
fixture.detectChanges();
// Set up the mock response before triggering the change
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200,
contentType: 'json',
responseText: analyticParamsMock.reportDefParamStatus
});
component.ngOnChanges({ reportId: change });
fixture.detectChanges();
await fixture.whenStable();
// Ensure the component has processed the report parameters
component.toggleParameters();
fixture.detectChanges();
await fixture.whenStable();
});
it('Should be able to change the report title', async () => {
spyOn(service, 'updateReport').and.returnValue(of(analyticParamsMock.reportDefParamStatus));
// Trigger change detection like the other working tests do
fixture.detectChanges();
await fixture.whenStable();
// Wait for the component to be properly initialized from the beforeEach
expect(component.reportParameters).toBeDefined();
expect(component.reportParameters.name).toBe('Fake Task overview status');
const title = element.querySelector<HTMLElement>('h4');
expect(title).not.toBeNull();
title.click();
fixture.detectChanges();