Merge branch 'master' into 2756-eventbus-in-workbench
[arvados.git] / apps / workbench / test / integration / folders_test.rb
index da3d4c067533caa313b2f0cd1138e34200a820a2..dc51b7724d7832ee8e363206230b764224de2c92 100644 (file)
@@ -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('.side-nav', 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
@@ -17,8 +16,11 @@ class FoldersTest < ActionDispatch::IntegrationTest
       find('.btn', text: 'Edit description').click
       find('.editable-input textarea').set('I just edited this.')
       find('.editable-submit').click
+      wait_for_ajax
     end
-    #find('.panel', text: 'I just edited this.')
+    visit current_path
+    assert(find?('.panel', text: 'I just edited this.'),
+           "Description update did not survive page refresh")
   end
 
   test 'Add a new name, then edit it, without creating a duplicate' do
@@ -26,13 +28,14 @@ class FoldersTest < ActionDispatch::IntegrationTest
     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', text: 'Contents') do
-      find('.tr[data-object-uuid="'+specimen_uuid+'"] .editable[data-name="name"]').click
+    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
+      wait_for_ajax
       find('.editable', text: 'Now I have a new name.')
     end
     visit current_path