Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / test / integration / pipeline_templates_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'integration_helper'
6
7 class PipelineTemplatesTest < ActionDispatch::IntegrationTest
8   test "JSON popup available for strange components" do
9     need_javascript
10     uuid = api_fixture("pipeline_templates")["components_is_jobspec"]["uuid"]
11     visit page_with_token("active", "/pipeline_templates/#{uuid}")
12     click_on "Components"
13     assert(page.has_no_text?("script_parameters"),
14            "components JSON visible without popup")
15     click_on "Show components JSON"
16     assert(page.has_text?("script_parameters"),
17            "components JSON not found")
18   end
19
20   test "pipeline template description" do
21     need_javascript
22     visit page_with_token("active", "/pipeline_templates")
23
24     # go to Two Part pipeline template
25     within first('tr', text: 'Two Part Pipeline Template') do
26       find(".fa-gears").click
27     end
28
29     # edit template description
30     within('.arv-description-as-subtitle') do
31       find('.fa-pencil').click
32       find('.editable-input textarea').set('*Textile description for pipeline template* - "Go to dashboard":/')
33       find('.editable-submit').click
34     end
35     wait_for_ajax
36
37     # Verfiy edited description
38     assert page.has_no_text? '*Textile description for pipeline template*'
39     assert page.has_text? 'Textile description for pipeline template'
40     assert page.has_link? 'Go to dashboard'
41     click_link 'Go to dashboard'
42     assert page.has_text? 'Recent pipelines and processes'
43
44     # again visit recent templates page and verify edited description
45     visit page_with_token("active", "/pipeline_templates")
46     assert page.has_no_text? '*Textile description for pipeline template*'
47     assert page.has_text? 'Textile description for pipeline template'
48   end
49 end