X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7fb83a3380e62721801a4980c48ba78208c7b2e2..6df740c374ba869fd2aba618ab6d26ef641b6efd:/apps/workbench/test/integration/folders_test.rb diff --git a/apps/workbench/test/integration/folders_test.rb b/apps/workbench/test/integration/folders_test.rb index dc51b7724d..7518d3cb26 100644 --- a/apps/workbench/test/integration/folders_test.rb +++ b/apps/workbench/test/integration/folders_test.rb @@ -3,12 +3,14 @@ require 'selenium-webdriver' require 'headless' class FoldersTest < ActionDispatch::IntegrationTest + setup do + Capybara.current_driver = Capybara.javascript_driver + end test 'Find a folder and edit its description' do - Capybara.current_driver = Capybara.javascript_driver visit page_with_token 'active', '/' find('nav a', text: 'Folders').click - find('.side-nav a,button', text: 'A Folder'). + find('.arv-folder-list a,button', text: 'A Folder'). click within('.panel', text: api_fixture('groups')['afolder']['name']) do find('span', text: api_fixture('groups')['afolder']['name']).click @@ -24,7 +26,6 @@ class FoldersTest < ActionDispatch::IntegrationTest end test 'Add a new name, then edit it, without creating a duplicate' do - Capybara.current_driver = Capybara.javascript_driver folder_uuid = api_fixture('groups')['afolder']['uuid'] specimen_uuid = api_fixture('specimens')['owned_by_afolder_with_no_name_link']['uuid'] visit page_with_token 'active', '/folders/' + folder_uuid @@ -45,4 +46,38 @@ class FoldersTest < ActionDispatch::IntegrationTest end end + test 'Create a folder and move it into a different folder' do + visit page_with_token 'active', '/folders' + find('input[value="Add a new folder"]').click + + within('.panel', text: 'New folder') do + find('.panel-title span', text: 'New folder').click + find('.editable-input input').set('Folder 1234') + find('.glyphicon-ok').click + end + wait_for_ajax + + visit '/folders' + find('input[value="Add a new folder"]').click + within('.panel', text: 'New folder') do + find('.panel-title span', text: 'New folder').click + find('.editable-input input').set('Folder 5678') + find('.glyphicon-ok').click + end + wait_for_ajax + + find('input[value="Move to..."]').click + find('.selectable', text: 'Folder 1234').click + find('a,button', text: 'Move').click + wait_for_ajax + + # Wait for the page to refresh and show the new parent folder in + # the Permissions panel: + find('.panel', text: 'Folder 1234') + + assert(find('.panel', text: 'Permissions inherited from'). + all('*', text: 'Folder 1234').any?, + "Folder 5678 should now be inside folder 1234") + end + end