X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f263c987ad0b144393edd28f281c5b19e84fdf0b..db1e389b74e37ecf4915168acdc72ea9ef624d9c:/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 d9322e60cd..c8753ac3e9 100644 --- a/apps/workbench/test/integration/folders_test.rb +++ b/apps/workbench/test/integration/folders_test.rb @@ -8,8 +8,7 @@ class FoldersTest < ActionDispatch::IntegrationTest Capybara.current_driver = Capybara.javascript_driver visit page_with_token 'active', '/' find('nav a', text: 'Folders').click - find('tr', text: 'A Folder'). - find('a,button', text: 'Show'). + find('.side-nav a,button', text: 'A Folder'). click within('.panel', text: api_fixture('groups')['afolder']['name']) do find('span', text: api_fixture('groups')['afolder']['name']).click @@ -21,4 +20,25 @@ class FoldersTest < ActionDispatch::IntegrationTest #find('.panel', text: 'I just edited this.') 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 + within('.panel tr', text: specimen_uuid) do + find(".editable[data-name='name']").click + find('.editable-input input').set('Now I have a name.') + find('.glyphicon-ok').click + find('.editable', text: 'Now I have a name.').click + find('.editable-input input').set('Now I have a new name.') + find('.glyphicon-ok').click + find('.editable', text: 'Now I have a new name.') + end + visit current_path + within '.panel', text: 'Contents' do + find '.editable', text: 'Now I have a new name.' + page.assert_no_selector '.editable', text: 'Now I have a name.' + end + end + end