diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-03-15 00:45:09 +0000 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-03-15 00:45:09 +0000 |
commit | 2a3127d05fd563138816e2451879f0fb8ffc9839 (patch) | |
tree | 11c67a11ae2e87e01edde4c8456ff25f54b104ca /spec | |
parent | b716680692b4d5f7565e29e8fbd1737d24cbf658 (diff) | |
parent | db59e735ae9c30bfa1e9d0800b6edfaaf6981f2a (diff) | |
download | gitlab-ce-2a3127d05fd563138816e2451879f0fb8ffc9839.tar.gz |
Merge branch '28187-project-name-cut-off-with-nested-groups' into 'master'
Toggle long Project names
Closes #28187
See merge request !9501
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/groups/group_name_toggle.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/features/groups/group_name_toggle.rb b/spec/features/groups/group_name_toggle.rb new file mode 100644 index 00000000000..ada4ac66e04 --- /dev/null +++ b/spec/features/groups/group_name_toggle.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +feature 'Group name toggle', js: true do + let(:group) { create(:group) } + let(:nested_group_1) { create(:group, parent: group) } + let(:nested_group_2) { create(:group, parent: nested_group_1) } + let(:nested_group_3) { create(:group, parent: nested_group_2) } + + before do + login_as :user + end + + it 'is not present for less than 3 groups' do + visit group_path(group) + expect(page).not_to have_css('.group-name-toggle') + + visit group_path(nested_group_1) + expect(page).not_to have_css('.group-name-toggle') + end + + it 'is present for nested group of 3 or more in the namespace' do + visit group_path(nested_group_2) + expect(page).to have_css('.group-name-toggle') + + visit group_path(nested_group_3) + expect(page).to have_css('.group-name-toggle') + end + + context 'for group with at least 3 groups' do + before do + visit group_path(nested_group_2) + end + + it 'should show the full group namespace when toggled' do + expect(page).not_to have_content(group.name) + expect(page).to have_css('.group-path.hidable', visible: false) + + click_button '...' + + expect(page).to have_content(group.name) + expect(page).to have_css('.group-path.hidable', visible: true) + end + end +end |