17686: Add test when there's no 'default: []'
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 18 May 2021 19:57:56 +0000 (15:57 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 18 May 2021 19:57:56 +0000 (15:57 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

cypress/fixtures/workflow_with_array_fields.yaml
cypress/fixtures/workflow_with_default_array_fields.yaml [new file with mode: 0644]
cypress/integration/favorites.spec.js

index fc71cf8691c19617e87580237084a132071e988c..33f03f6b3b63d777c3f5e823ab9e3a17c69a6154 100644 (file)
     class: http://arvados.org/cwl#WorkflowRunnerResources
   id: "#main"
   inputs:
-  - default: []
-    id: "#main/bar"
+  - id: "#main/bar"
     type:
       items: Directory
       type: array
-  - default: []
-    id: "#main/foo"
+  - id: "#main/foo"
     type:
       items: File
       type: array
diff --git a/cypress/fixtures/workflow_with_default_array_fields.yaml b/cypress/fixtures/workflow_with_default_array_fields.yaml
new file mode 100644 (file)
index 0000000..fc71cf8
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+---
+"$graph":
+- class: Workflow
+  cwlVersion: v1.2
+  hints:
+  - acrContainerImage: 7009415fdc959d0c2819ee2e9db96561+261
+    class: http://arvados.org/cwl#WorkflowRunnerResources
+  id: "#main"
+  inputs:
+  - default: []
+    id: "#main/bar"
+    type:
+      items: Directory
+      type: array
+  - default: []
+    id: "#main/foo"
+    type:
+      items: File
+      type: array
+  outputs: []
+  steps: []
+cwlVersion: v1.2
index 6750650dc2789d66257463e4b37c9bbcf0e4fc70..c91514836b09a7af6d746b4d7c9e1acc42c3dc5b 100644 (file)
@@ -205,7 +205,8 @@ describe('Favorites tests', function () {
             });
     });
 
-    it('can select multi files when creating workflow', () => {
+    ['workflow_with_array_fields.yaml', 'workflow_with_default_array_fields.yaml'].forEach((yamlfile) =>
+    it('can select multi files when creating workflow '+yamlfile, () => {
         cy.createProject({
             owningUser: activeUser,
             projectName: 'myProject1',
@@ -228,7 +229,7 @@ describe('Favorites tests', function () {
 
         cy.getAll('@myProject1', '@testCollection', '@testCollection2')
             .then(function ([myProject1, testCollection, testCollection2]) {
-                cy.readFile('cypress/fixtures/workflow_with_array_fields.yaml').then(workflow => {
+                cy.readFile('cypress/fixtures/'+yamlfile).then(workflow => {
                     cy.createWorkflow(adminUser.token, {
                         name: `TestWorkflow${Math.floor(Math.random() * 999999)}.cwl`,
                         definition: workflow,
@@ -300,5 +301,5 @@ describe('Favorites tests', function () {
                         cy.contains(testCollection2.name);
                     });
             });
-    });
-});
\ No newline at end of file
+    }));
+});