2760: Show folder hierarchy on regular page, not in left nav
[arvados.git] / apps / workbench / test / integration / folders_test.rb
1 require 'integration_helper'
2 require 'selenium-webdriver'
3 require 'headless'
4
5 class FoldersTest < ActionDispatch::IntegrationTest
6
7   test 'Find a folder and edit its description' do
8     Capybara.current_driver = Capybara.javascript_driver
9     visit page_with_token 'active', '/'
10     find('nav a', text: 'Folders').click
11     find('.arv-folder-list a,button', text: 'A Folder').
12       click
13     within('.panel', text: api_fixture('groups')['afolder']['name']) do
14       find('span', text: api_fixture('groups')['afolder']['name']).click
15       find('.glyphicon-ok').click
16       find('.btn', text: 'Edit description').click
17       find('.editable-input textarea').set('I just edited this.')
18       find('.editable-submit').click
19       wait_for_ajax
20     end
21     visit current_path
22     assert(find?('.panel', text: 'I just edited this.'),
23            "Description update did not survive page refresh")
24   end
25
26   test 'Add a new name, then edit it, without creating a duplicate' do
27     Capybara.current_driver = Capybara.javascript_driver
28     folder_uuid = api_fixture('groups')['afolder']['uuid']
29     specimen_uuid = api_fixture('specimens')['owned_by_afolder_with_no_name_link']['uuid']
30     visit page_with_token 'active', '/folders/' + folder_uuid
31     within('.panel tr', text: specimen_uuid) do
32       find(".editable[data-name='name']").click
33       find('.editable-input input').set('Now I have a name.')
34       find('.glyphicon-ok').click
35       find('.editable', text: 'Now I have a name.').click
36       find('.editable-input input').set('Now I have a new name.')
37       find('.glyphicon-ok').click
38       wait_for_ajax
39       find('.editable', text: 'Now I have a new name.')
40     end
41     visit current_path
42     within '.panel', text: 'Contents' do
43       find '.editable', text: 'Now I have a new name.'
44       page.assert_no_selector '.editable', text: 'Now I have a name.'
45     end
46   end
47
48 end