summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/specs/features/ee/browser_ui/2_plan/scoped_labels/editing_scoped_labels_spec.rb47
1 files changed, 33 insertions, 14 deletions
diff --git a/qa/qa/specs/features/ee/browser_ui/2_plan/scoped_labels/editing_scoped_labels_spec.rb b/qa/qa/specs/features/ee/browser_ui/2_plan/scoped_labels/editing_scoped_labels_spec.rb
index d21f4d7bc68..92c5783aa01 100644
--- a/qa/qa/specs/features/ee/browser_ui/2_plan/scoped_labels/editing_scoped_labels_spec.rb
+++ b/qa/qa/specs/features/ee/browser_ui/2_plan/scoped_labels/editing_scoped_labels_spec.rb
@@ -1,20 +1,29 @@
module QA
context 'Plan' do
describe 'Editing scoped labels on issues' do
+ let(:initial_label) { 'animal::fox' }
+ let(:new_label_same_scope) { 'animal::dolphin' }
+ let(:new_label_different_scope) { 'plant::orchid' }
+
+ let(:initial_label_multi_colon) { 'group::car::ferrari' }
+ let(:new_label_same_scope_multi_colon) { 'group::car::porsche' }
+ let(:new_label_different_scope_multi_colon) { 'group::truck::mercedes-bens' }
+
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
- @initial_label = 'animal::fox'
- @new_label_same_scope = 'animal::dolphin'
- @new_label_different_scope = 'plant::orchid'
-
issue = Resource::Issue.fabricate_via_api! do |issue|
- issue.title = 'Issue to test the scoped labels'
- issue.labels = [@initial_label]
+ issue.title = 'Issue to test scoped labels'
+ issue.labels = [initial_label, initial_label_multi_colon]
end
- [@new_label_same_scope, @new_label_different_scope].each do |label|
+ [
+ new_label_same_scope,
+ new_label_different_scope,
+ new_label_same_scope_multi_colon,
+ new_label_different_scope_multi_colon
+ ].each do |label|
Resource::Label.fabricate_via_api! do |l|
l.project = issue.project
l.title = label
@@ -24,15 +33,25 @@ module QA
issue.visit!
end
- it 'correctly applies scoped labels depending on if they are from the same or a different scope' do
+ it 'correctly applies simple and multiple colon scoped pairs labels' do
Page::Project::Issue::Show.perform do |show|
- show.select_labels_and_refresh [@new_label_same_scope, @new_label_different_scope]
+ show.select_labels_and_refresh([
+ new_label_same_scope,
+ new_label_different_scope,
+ new_label_same_scope_multi_colon,
+ new_label_different_scope_multi_colon
+ ])
- expect(page).to have_content("added #{@initial_label}")
- expect(page).to have_content("added #{@new_label_same_scope} #{@new_label_different_scope} scoped labels and automatically removed #{@initial_label}")
- expect(show.text_of_labels_block).to have_content(@new_label_same_scope)
- expect(show.text_of_labels_block).to have_content(@new_label_different_scope)
- expect(show.text_of_labels_block).not_to have_content(@initial_label)
+ expect(page).to have_content("added #{initial_label} #{initial_label_multi_colon}")
+ expect(page).to have_content(
+ "added #{new_label_same_scope} #{new_label_same_scope_multi_colon} #{new_label_different_scope_multi_colon} #{new_label_different_scope} scoped labels and automatically removed #{initial_label} #{initial_label_multi_colon}"
+ )
+ expect(show.text_of_labels_block).to have_content(new_label_same_scope)
+ expect(show.text_of_labels_block).to have_content(new_label_different_scope)
+ expect(show.text_of_labels_block).not_to have_content(initial_label)
+ expect(show.text_of_labels_block).to have_content(new_label_same_scope_multi_colon)
+ expect(show.text_of_labels_block).to have_content(new_label_different_scope_multi_colon)
+ expect(show.text_of_labels_block).not_to have_content(initial_label_multi_colon)
end
end
end