15921: Updates tests to not expect trailing slashes on API calls.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 10 Dec 2019 21:44:33 +0000 (18:44 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 10 Dec 2019 21:44:33 +0000 (18:44 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/services/common-service/common-resource-service.test.ts
src/services/project-service/project-service.test.ts

index a6a8b9d069f223aba86703924489885010d457b5..41a584fd78582056a279b2cd977b4731109e9bd8 100644 (file)
@@ -32,7 +32,7 @@ describe("CommonResourceService", () => {
 
     it("#create", async () => {
         axiosMock
-            .onPost("/resource/")
+            .onPost("/resource")
             .reply(200, { owner_uuid: "ownerUuidValue" });
 
         const commonResourceService = new CommonResourceService(axiosInstance, "resource", actions);
@@ -44,7 +44,7 @@ describe("CommonResourceService", () => {
         axiosInstance.post = jest.fn(() => Promise.resolve({data: {}}));
         const commonResourceService = new CommonResourceService(axiosInstance, "resource", actions);
         await commonResourceService.create({ ownerUuid: "ownerUuidValue" });
-        expect(axiosInstance.post).toHaveBeenCalledWith("/resource/", {owner_uuid: "ownerUuidValue"});
+        expect(axiosInstance.post).toHaveBeenCalledWith("/resource", {owner_uuid: "ownerUuidValue"});
     });
 
     it("#delete", async () => {
@@ -80,7 +80,7 @@ describe("CommonResourceService", () => {
 
     it("#list", async () => {
         axiosMock
-            .onGet("/resource/")
+            .onGet("/resource")
             .reply(200, {
                 kind: "kind",
                 offset: 2,
index 9052360627c6f68ff0d95253efa6b0f4ae88bc55..aac04d96359dffb382e710bcd09a4b3e5cc5de98 100644 (file)
@@ -18,7 +18,7 @@ describe("CommonResourceService", () => {
         axiosInstance.post = jest.fn(() => Promise.resolve({ data: {} }));
         const projectService = new ProjectService(axiosInstance, actions);
         const resource = await projectService.create({ name: "nameValue" });
-        expect(axiosInstance.post).toHaveBeenCalledWith("/groups/", {
+        expect(axiosInstance.post).toHaveBeenCalledWith("/groups", {
             name: "nameValue",
             group_class: "project"
         });
@@ -28,7 +28,7 @@ describe("CommonResourceService", () => {
         axiosInstance.get = jest.fn(() => Promise.resolve({ data: {} }));
         const projectService = new ProjectService(axiosInstance, actions);
         const resource = await projectService.list();
-        expect(axiosInstance.get).toHaveBeenCalledWith("/groups/", {
+        expect(axiosInstance.get).toHaveBeenCalledWith("/groups", {
             params: {
                 filters: "[" + new FilterBuilder()
                     .addEqual("groupClass", "project")