fix(editor): Separate cloud endpoint calls (#7312)

This PR untangles calls to cloud endpoints so failure in one of them
doesn't stop others to go through.
This commit is contained in:
Milorad FIlipović
2023-10-02 14:25:03 +02:00
committed by GitHub
parent 1691223789
commit 04dfcd73be
3 changed files with 37 additions and 17 deletions

View File

@@ -123,7 +123,8 @@ describe('UI store', () => {
.spyOn(cloudPlanApi, 'getCloudUserInfo')
.mockResolvedValue(getUserCloudInfo(true));
setupOwnerAndCloudDeployment();
await cloudPlanStore.getOwnerCurrentPlan();
await cloudPlanStore.checkForCloudPlanData();
await cloudPlanStore.fetchUserCloudAccount();
expect(fetchCloudSpy).toHaveBeenCalled();
expect(fetchUserCloudAccountSpy).toHaveBeenCalled();
expect(uiStore.bannerStack).toContain('TRIAL');
@@ -137,7 +138,8 @@ describe('UI store', () => {
.spyOn(cloudPlanApi, 'getCloudUserInfo')
.mockResolvedValue(getUserCloudInfo(true));
setupOwnerAndCloudDeployment();
await cloudPlanStore.getOwnerCurrentPlan();
await cloudPlanStore.checkForCloudPlanData();
await cloudPlanStore.fetchUserCloudAccount();
expect(fetchCloudSpy).toHaveBeenCalled();
expect(fetchUserCloudAccountSpy).toHaveBeenCalled();
expect(uiStore.bannerStack).toContain('TRIAL_OVER');
@@ -151,7 +153,8 @@ describe('UI store', () => {
.spyOn(cloudPlanApi, 'getCloudUserInfo')
.mockResolvedValue(getUserCloudInfo(false));
setupOwnerAndCloudDeployment();
await cloudPlanStore.getOwnerCurrentPlan();
await cloudPlanStore.checkForCloudPlanData();
await cloudPlanStore.fetchUserCloudAccount();
expect(fetchCloudSpy).toHaveBeenCalled();
expect(fetchUserCloudAccountSpy).toHaveBeenCalled();
expect(uiStore.bannerStack).toContain('TRIAL_OVER');