npm package diff

Package: @forge/events

Versions: 0.9.2-next.0-experimental-c7a7d36 - 0.8.38-experimental-204139e

File: package/src/__test__/jobProgress.test.ts

Index: package/src/__test__/jobProgress.test.ts
===================================================================
--- package/src/__test__/jobProgress.test.ts
+++ package/src/__test__/jobProgress.test.ts
@@ -22,16 +22,12 @@
       );
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       const response = await jobProgress.getStats();
       const { success, inProgress, failed } = await response.json();
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
       expect(success).toEqual(100);
       expect(inProgress).toEqual(50);
       expect(failed).toEqual(1);
     });
@@ -47,30 +43,22 @@
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       await expect(jobProgress.getStats()).rejects.toThrow(
         new JobDoesNotExistError(`The job test-job-id was not found for the queue test-queue-name.`)
       );
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
     });
 
     it('should throw RateLimitError', async () => {
       const apiClientMock = getMockFetchMethod({}, 429);
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       await expect(jobProgress.getStats()).rejects.toThrow(new RateLimitError(`Too many requests.`));
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
     });
 
     it('should throw InternalServerError', async () => {
       const apiClientMock = getMockFetchMethod(
@@ -84,32 +72,24 @@
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       await expect(jobProgress.getStats()).rejects.toThrow(
         new InternalServerError(`513 Status Text: Service is not available`, 513)
       );
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
     });
   });
 
   describe('cancel', () => {
     it('should call the queue/cancel endpoint', async () => {
       const apiClientMock = getMockFetchMethod({}, 204);
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       const response = await jobProgress.cancel();
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/cancel/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/cancel/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
       expect(response.status).toEqual(204);
     });
 
     it('should throw JobDoesNotExistError', async () => {
@@ -123,16 +103,12 @@
       const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
       await expect(jobProgress.cancel()).rejects.toThrow(
         new JobDoesNotExistError(`The job test-job-id was not found for the queue test-queue-name.`)
       );
-      verifyApiClientCalledWith(
-        apiClientMock,
-        '/webhook/queue/cancel/{contextAri}/{environmentId}/{appId}/{appVersion}',
-        {
-          queueName: 'test-queue-name',
-          jobId: 'test-job-id'
-        }
-      );
+      verifyApiClientCalledWith(apiClientMock, '/webhook/queue/cancel/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+        queueName: 'test-queue-name',
+        jobId: 'test-job-id'
+      });
     });
   });
 
   it('should throw InternalServerError when WHP returns 422 response', async () => {
@@ -146,9 +122,9 @@
     await expect(jobProgress.getStats()).rejects.toThrow(
       new InternalServerError(`422 Status Text: jobId must not be null, queueName must not be null`)
     );
 
-    verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
+    verifyApiClientCalledWith(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
       queueName: 'test-queue-name',
       jobId: 'test-job-id'
     });
   });