summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSam Rose <sam@gitlab.com>2017-02-28 21:59:55 -0500
committerSam Rose <sam@gitlab.com>2017-03-13 19:25:13 -0400
commitdb59e735ae9c30bfa1e9d0800b6edfaaf6981f2a (patch)
tree2d645047a5a692b49f516feb158d057ef82f344e /spec
parentcc64eda987d2b1dfc7c0af4255bd09f072301f9c (diff)
downloadgitlab-ce-db59e735ae9c30bfa1e9d0800b6edfaaf6981f2a.tar.gz
Toggle project name if too long28187-project-name-cut-off-with-nested-groups
Diffstat (limited to 'spec')
-rw-r--r--spec/features/groups/group_name_toggle.rb44
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