20219: Make cypress collection replace files method more specific
authorStephen Smith <stephen@curii.com>
Mon, 21 Aug 2023 16:30:23 +0000 (12:30 -0400)
committerStephen Smith <stephen@curii.com>
Mon, 21 Aug 2023 16:30:23 +0000 (12:30 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

cypress/support/commands.js

index 2bb2ec278f6b5453e97c1fc3c5f3bac2bebe6355..fadd73e0655b722202999a763763d662ba3ff5a5 100644 (file)
@@ -196,7 +196,12 @@ Cypress.Commands.add(
 
 Cypress.Commands.add(
     "collectionReplaceFiles", (token, uuid, data) => {
-        return cy.updateResource(token, 'collections', uuid, JSON.stringify(data))
+        return cy.updateResource(token, 'collections', uuid, {
+            collection: {
+                preserve_version: true,
+            },
+            replace_files: JSON.stringify(data)
+        })
     }
 )
 
@@ -286,12 +291,7 @@ Cypress.Commands.add(
                     }).then(() => (
                         // Create empty directory for container uuid
                         cy.collectionReplaceFiles(token, collection.uuid, {
-                            collection: {
-                                preserve_version: true,
-                            },
-                            replace_files: {
-                                [`/${containerLogFolderPrefix}${containerRequest.container_uuid}`]: "d41d8cd98f00b204e9800998ecf8427e+0"
-                            }
+                            [`/${containerLogFolderPrefix}${containerRequest.container_uuid}`]: "d41d8cd98f00b204e9800998ecf8427e+0"
                         }).then(() => (
                             // Put new log file with contents into fake log collection
                             cy.doWebDAVRequest(