Commit b4c6dc1d authored by tauriedavis's avatar tauriedavis Committed by Annabel Dunstone Gray

fixes project_group_links spec by adding click tab event

parent b4056e1b
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
&.active { &.active {
background: $white-light; background: $white-light;
} }
&:first-child { &:first-child {
border-right: 1px solid $border-color; border-right: 1px solid $border-color;
} }
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
- if can?(current_user, :admin_project_member, @project) - if can?(current_user, :admin_project_member, @project)
%ul.nav-links.project-member-tabs{ role: 'tablist' } %ul.nav-links.project-member-tabs{ role: 'tablist' }
%li.active{ role: 'presentation' } %li.active{ role: 'presentation' }
%a{ href: '#add-member-pane', data: { toggle: 'tab' }, role: 'tab' } Add member %a{ href: '#add-member-pane', id: 'add-member-tab', data: { toggle: 'tab' }, role: 'tab' } Add member
- if @project.allowed_to_share_with_group? - if @project.allowed_to_share_with_group?
%li{ role: 'presentation' } %li{ role: 'presentation' }
%a{ href: '#share-with-group-pane', data: { toggle: 'tab' }, role: 'tab' } Share with group %a{ href: '#share-with-group-pane', id: 'share-with-group-tab', data: { toggle: 'tab' }, role: 'tab' } Share with group
.tab-content.project-member-tab-content .tab-content.project-member-tab-content
.tab-pane.active{ id: 'add-member-pane', role: 'tabpanel' } .tab-pane.active{ id: 'add-member-pane', role: 'tabpanel' }
......
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
.clearable-input .clearable-input
= text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date-groups', placeholder: 'Expiration date', id: 'expires_at_groups' = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date-groups', placeholder: 'Expiration date', id: 'expires_at_groups'
%i.clear-icon.js-clear-input %i.clear-icon.js-clear-input
= submit_tag "Share", class: "btn btn-create" = submit_tag "Share", class: "btn btn-create"
\ No newline at end of file
...@@ -5,18 +5,19 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps ...@@ -5,18 +5,19 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
include Select2Helper include Select2Helper
step 'I should see project already shared with group "Ops"' do step 'I should see project already shared with group "Ops"' do
page.within '.enabled-groups' do page.within '.project-members-groups' do
expect(page).to have_content "Ops" expect(page).to have_content "Ops"
end end
end end
step 'I should see project is not shared with group "Market"' do step 'I should see project is not shared with group "Market"' do
page.within '.enabled-groups' do page.within '.project-members-groups' do
expect(page).not_to have_content "Market" expect(page).not_to have_content "Market"
end end
end end
step 'I select group "Market" for share' do step 'I select group "Market" for share' do
click_link 'Share with group'
group = Group.find_by(path: 'market') group = Group.find_by(path: 'market')
select2(group.id, from: "#link_group_id") select2(group.id, from: "#link_group_id")
select "Master", from: 'link_group_access' select "Master", from: 'link_group_access'
...@@ -24,7 +25,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps ...@@ -24,7 +25,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end end
step 'I should see project is shared with group "Market"' do step 'I should see project is shared with group "Market"' do
page.within '.enabled-groups' do page.within '.project-members-groups' do
expect(page).to have_content "Market" expect(page).to have_content "Market"
end end
end end
......
...@@ -16,6 +16,8 @@ feature 'Project group links', :feature, :js do ...@@ -16,6 +16,8 @@ feature 'Project group links', :feature, :js do
before do before do
visit namespace_project_settings_members_path(project.namespace, project) visit namespace_project_settings_members_path(project.namespace, project)
click_on 'share-with-group-tab'
select2 group.id, from: '#link_group_id' select2 group.id, from: '#link_group_id'
fill_in 'expires_at_groups', with: (Time.current + 4.5.days).strftime('%Y-%m-%d') fill_in 'expires_at_groups', with: (Time.current + 4.5.days).strftime('%Y-%m-%d')
page.find('body').click page.find('body').click
...@@ -23,7 +25,7 @@ feature 'Project group links', :feature, :js do ...@@ -23,7 +25,7 @@ feature 'Project group links', :feature, :js do
end end
it 'shows the expiration time with a warning class' do it 'shows the expiration time with a warning class' do
page.within('.enabled-groups') do page.within('.project-members-groups') do
expect(page).to have_content('expires in 4 days') expect(page).to have_content('expires in 4 days')
expect(page).to have_selector('.text-warning') expect(page).to have_selector('.text-warning')
end end
...@@ -43,6 +45,7 @@ feature 'Project group links', :feature, :js do ...@@ -43,6 +45,7 @@ feature 'Project group links', :feature, :js do
it 'does not show ancestors', :nested_groups do it 'does not show ancestors', :nested_groups do
visit namespace_project_settings_members_path(project.namespace, project) visit namespace_project_settings_members_path(project.namespace, project)
click_on 'share-with-group-tab'
click_link 'Search for a group' click_link 'Search for a group'
page.within '.select2-drop' do page.within '.select2-drop' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment