[ARVADOS] updated: 9c81bfe7c85658ddab49a985b923a248824a0f99

git at public.curoverse.com git at public.curoverse.com
Tue Sep 2 18:19:09 EDT 2014


Summary of changes:
 apps/workbench/test/integration/projects_test.rb | 68 ++++++++++++++++++++++++
 services/api/test/fixtures/collections.yml       | 12 +++++
 2 files changed, 80 insertions(+)

       via  9c81bfe7c85658ddab49a985b923a248824a0f99 (commit)
      from  4c517008ac098b8bd107ed22edce0c50ba20f648 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9c81bfe7c85658ddab49a985b923a248824a0f99
Author: radhika <radhika at curoverse.com>
Date:   Tue Sep 2 18:16:46 2014 -0400

    3637: add integration tests for "copy", "move", and "remove" operations from the project selection dropdown.

diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index 72689a9..3fdd768 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -258,4 +258,72 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     assert(page.has_no_selector?(".selectable[data-object-uuid=\"#{bad_uuid}\"]"),
            "'share with groups' listing includes project")
   end
+
+  [
+    'Move',
+    'Remove',
+    'Copy',
+  ].each do |action|
+    test "selection #{action} for project" do
+      src = api_fixture('groups')['aproject']
+      dest = api_fixture('groups')['asubproject']
+      my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
+
+      perform_selection_action src, dest, my_collection, action
+
+      case action
+      when 'Copy'
+        assert page.has_text?(my_collection['name']), 'Collection not found in src project after copy'
+        visit page_with_token 'active', '/'
+        find('.arv-project-list a,button', text: dest['name']).click
+        assert page.has_text?(my_collection['name']), 'Collection not found in dest project after copy'
+
+        # now remove it from destination project to restore to original state
+        perform_selection_action dest, nil, my_collection, 'Remove'
+      when 'Move'
+        assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after move'
+        visit page_with_token 'active', '/'
+        find('.arv-project-list a,button', text: dest['name']).click
+        assert page.has_text?(my_collection['name']), 'Collection not found in dest project after move'
+
+        # move it back to src project to restore to original state
+        perform_selection_action dest, src, my_collection, action
+      when 'Remove'
+        assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after remove'
+        visit page_with_token 'active', '/'
+        find('.arv-project-list a,button', text: 'Home').click
+        assert page.has_text?(my_collection['name']), 'Collection not found in home project after remove'
+      end
+    end
+  end
+
+  def perform_selection_action src, dest, item, action
+    visit page_with_token 'active', '/'
+    find('.arv-project-list a,button', text: src['name']).click
+    assert page.has_text?(item['name']), 'Collection not found in src project'
+
+    within('tr', text: item['name']) do
+      find('input[type=checkbox]').click
+    end
+
+    click_button 'Selection...'
+
+    within('.selection-action-container') do
+      assert page.has_text?("Compare selected"), "Compare selected link text not found"
+      assert page.has_link?("Copy selected"), "Copy selected link not found"
+      assert page.has_link?("Move selected"), "Move selected link not found"
+      assert page.has_link?("Remove selected"), "Remove selected link not found"
+
+      click_link "#{action} selected"
+    end
+
+    # select the destination project if a Copy or Move action is being performed
+    if action == 'Copy' || action == 'Move'
+      within(".modal-container") do
+        find('.selectable', text: dest['name']).click
+        find('.modal-footer a,button', text: action).click
+        wait_for_ajax
+      end
+    end
+  end
 end
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index 74c8681..acc6cc0 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -161,3 +161,15 @@ baz_file_in_asubproject:
   updated_at: 2014-02-03T17:22:54Z
   manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n"
   name: baz_file
+
+collection_to_move_around_in_aproject:
+  uuid: zzzzz-4zz18-0mri2x4u7ft1234
+  portable_data_hash: ea10d51bcf88862dbcc36eb292017dfd+45
+  owner_uuid: zzzzz-j7d0g-v955i6s2oi1cbso
+  created_at: 2014-02-03T17:22:54Z
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+  modified_at: 2014-02-03T17:22:54Z
+  updated_at: 2014-02-03T17:22:54Z
+  manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n"
+  name: collection_to_move_around

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list