- page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
- page.assert_selector 'li.disabled', text: 'Compare selected'
- page.assert_selector 'li.disabled', text: 'Copy selected'
- page.assert_no_selector 'li.disabled', text: 'Move selected'
- page.assert_selector 'li', text: 'Move selected'
- page.assert_no_selector 'li.disabled', text: 'Remove selected'
- page.assert_selector 'li', text: 'Remove selected'
+ assert_selector 'li.disabled', text: 'Create new collection with selected collections'
+ assert_selector 'li.disabled', text: 'Compare selected'
+ assert_selector 'li.disabled', text: 'Copy selected'
+ assert_no_selector 'li.disabled', text: 'Move selected'
+ assert_selector 'li', text: 'Move selected'
+ assert_no_selector 'li.disabled', text: 'Remove selected'
+ assert_selector 'li', text: 'Remove selected'
+ end
+
+ # select subproject and a collection and verify that copy action is still disabled
+ visit page_with_token 'active', '/'
+ find("#projects-menu").click
+ find(".dropdown-menu a", text: my_project['name']).click
+
+ click_link 'Subprojects'
+ assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
+
+ within('tr', text: my_subproject['name']) do
+ find('input[type=checkbox]').click
+ end
+
+ click_link 'Data collections'
+ assert page.has_text?(my_collection['name']), 'Collection not found in project'
+
+ within('tr', text: my_collection['name']) do
+ find('input[type=checkbox]').click
+ end
+
+ click_link 'Subprojects'
+ click_button 'Selection'
+ within('.selection-action-container') do
+ assert_selector 'li.disabled', text: 'Create new collection with selected collections'
+ assert_selector 'li.disabled', text: 'Compare selected'
+ assert_selector 'li.disabled', text: 'Copy selected'
+ assert_no_selector 'li.disabled', text: 'Move selected'
+ assert_selector 'li', text: 'Move selected'
+ assert_no_selector 'li.disabled', text: 'Remove selected'
+ assert_selector 'li', text: 'Remove selected'