From c896ae7be889dd3935795b1079ab7a11a12f52e0 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 25 May 2018 12:38:45 +0100 Subject: BE review --- spec/features/projects/labels/update_prioritization_spec.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec') diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index ae8b1364ec7..9500e3f3311 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -23,8 +23,10 @@ feature 'Prioritize labels' do expect(page).to have_content('Star labels to start sorting by priority') page.within('.other-labels') do + screenshot_and_open_image all('.js-toggle-priority')[1].click wait_for_requests + screenshot_and_open_image expect(page).not_to have_content('feature') end -- cgit v1.2.3 From fad343ca5b1fcdd4d01e415f31ee4a9fddb4eb99 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 09:53:33 +0100 Subject: Remove screenshots --- spec/features/projects/labels/update_prioritization_spec.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'spec') diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 9500e3f3311..ae8b1364ec7 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -23,10 +23,8 @@ feature 'Prioritize labels' do expect(page).to have_content('Star labels to start sorting by priority') page.within('.other-labels') do - screenshot_and_open_image all('.js-toggle-priority')[1].click wait_for_requests - screenshot_and_open_image expect(page).not_to have_content('feature') end -- cgit v1.2.3 From c9e4c1760dae5e1916bb5ad22f260b7fd0b58475 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 10:25:21 +0100 Subject: Fix project subscription_spec --- spec/features/projects/labels/subscription_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index 70e8d436dcb..d5f5036ec72 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -36,7 +36,7 @@ feature 'Labels subscription' do within "#group_label_#{feature.id}" do expect(page).not_to have_button 'Unsubscribe' - click_link_on_dropdown('Group level') + click_link_on_dropdown('Subscribe at group level') expect(page).not_to have_selector('.dropdown-group-label') expect(page).to have_button 'Unsubscribe' @@ -45,7 +45,7 @@ feature 'Labels subscription' do expect(page).to have_selector('.dropdown-group-label') - click_link_on_dropdown('Project level') + click_link_on_dropdown('Subscribe at project level') expect(page).not_to have_selector('.dropdown-group-label') expect(page).to have_button 'Unsubscribe' @@ -67,6 +67,8 @@ feature 'Labels subscription' do def click_link_on_dropdown(text) find('.dropdown-group-label').click + screenshot_and_open_image + page.within('.dropdown-group-label') do find('a.js-subscribe-button', text: text).click end -- cgit v1.2.3 From 35b5c830a783eb36f86d9f5e8f8c08595fd62c54 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 10:48:26 +0100 Subject: Further fixes for project subscription_spec --- spec/features/projects/labels/subscription_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index d5f5036ec72..fafd338e448 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -67,10 +67,8 @@ feature 'Labels subscription' do def click_link_on_dropdown(text) find('.dropdown-group-label').click - screenshot_and_open_image - page.within('.dropdown-group-label') do - find('a.js-subscribe-button', text: text).click + find('.js-subscribe-button', text: text).click end end end -- cgit v1.2.3 From 3b3645136bd524a5e9f79558ab16be976cfe5282 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 11:07:48 +0100 Subject: Fix update_prioritization_spec --- spec/features/projects/labels/update_prioritization_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index ae8b1364ec7..359381c391c 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -102,16 +102,16 @@ feature 'Prioritize labels' do drag_to(selector: '.label-list-item', from_index: 1, to_index: 2) page.within('.prioritized-labels') do - expect(first('li')).to have_content('feature') - expect(page.all('li').last).to have_content('bug') + expect(first('.label-list-item')).to have_content('feature') + expect(page.all('.label-list-item').last).to have_content('bug') end refresh wait_for_requests page.within('.prioritized-labels') do - expect(first('li')).to have_content('feature') - expect(page.all('li').last).to have_content('bug') + expect(first('.label-list-item')).to have_content('feature') + expect(page.all('.label-list-item').last).to have_content('bug') end end -- cgit v1.2.3 From cd0be3ba456f5cf61ed72f1c6b36bef799d7eaaf Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 12:11:14 +0100 Subject: Fix user_removes_labels_spec --- .../projects/labels/user_removes_labels_spec.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'spec') diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index f4fda6de465..120c618b530 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -17,8 +17,9 @@ describe "User removes labels" do end it "removes label" do - page.within(".labels") do + page.within(".other-labels") do page.first(".label-list-item") do + first('.js-label-options-dropdown').click first(".remove-row").click first(:link, "Delete label").click end @@ -36,17 +37,15 @@ describe "User removes labels" do end it "removes all labels" do - page.within(".labels") do - loop do - li = page.first(".label-list-item") - break unless li - - li.click_link("Delete") - click_link("Delete label") - end - - expect(page).to have_content("Generate a default set of labels").and have_content("New label") + loop do + li = page.first(".label-list-item") + break unless li + li.find('.js-label-options-dropdown').click + li.click_button("Delete") + click_link("Delete label") end + + expect(page).to have_content("Generate a default set of labels").and have_content("New label") end end end -- cgit v1.2.3 From 9b9cdc984cb785ceee4ed1902625c65492640621 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Tue, 29 May 2018 12:50:29 +0100 Subject: fix lint --- spec/features/projects/labels/user_removes_labels_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec') diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index 120c618b530..efa74015c6e 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -40,6 +40,7 @@ describe "User removes labels" do loop do li = page.first(".label-list-item") break unless li + li.find('.js-label-options-dropdown').click li.click_button("Delete") click_link("Delete label") -- cgit v1.2.3