Commit f2300082 authored by Tiger Watson's avatar Tiger Watson

Merge branch 'pl-feature-spec-setting-monitor' into 'master'

Wait for all pending requests in Monitor settings feature spec

See merge request gitlab-org/gitlab!71662
parents 4a1dff32 6bb6a5b2
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Settings > For a forked project', :js do RSpec.describe 'Projects > Settings > For a forked project', :js do
let_it_be(:project) { create(:project, :repository, create_templates: :issue) } let_it_be(:project) { create(:project, :repository, create_templates: :issue) }
let(:user) { project.owner} let(:user) { project.owner }
before do before do
sign_in(user) sign_in(user)
...@@ -16,7 +16,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -16,7 +16,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
visit project_path(project) visit project_path(project)
wait_for_requests wait_for_requests
expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]', text: 'Monitor', visible: false) expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]',
text: 'Monitor', visible: :hidden)
end end
end end
...@@ -42,7 +43,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -42,7 +43,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
expect(find_field(send_email)).to be_checked expect(find_field(send_email)).to be_checked
end end
it 'updates form values', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/333665' do it 'updates form values' do
check(create_issue) check(create_issue)
uncheck(send_email) uncheck(send_email)
click_on('No template selected') click_on('No template selected')
...@@ -52,10 +53,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -52,10 +53,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
click_settings_tab click_settings_tab
expect(find_field(create_issue)).to be_checked expect(find_field(create_issue)).to be_checked
expect(page).to have_selector(:id, 'alert-integration-settings-issue-template', text: 'bug')
click_settings_tab
expect(find_field(send_email)).not_to be_checked expect(find_field(send_email)).not_to be_checked
expect(page).to have_selector(:id, 'alert-integration-settings-issue-template', text: 'bug')
end end
def click_settings_tab def click_settings_tab
...@@ -68,13 +67,15 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -68,13 +67,15 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
page.within '[data-testid="alert-integration-settings"]' do page.within '[data-testid="alert-integration-settings"]' do
click_button 'Save changes' click_button 'Save changes'
end end
wait_for_all_requests
end end
end end
context 'error tracking settings form' do describe 'error tracking settings form' do
let(:sentry_list_projects_url) { 'http://sentry.example.com/api/0/projects/' } let(:sentry_list_projects_url) { 'http://sentry.example.com/api/0/projects/' }
context 'success path' do context 'when project dropdown is loaded' do
let(:projects_sample_response) do let(:projects_sample_response) do
Gitlab::Utils.deep_indifferent_access( Gitlab::Utils.deep_indifferent_access(
Gitlab::Json.parse(fixture_file('sentry/list_projects_sample_response.json')) Gitlab::Json.parse(fixture_file('sentry/list_projects_sample_response.json'))
...@@ -123,7 +124,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -123,7 +124,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'project dropdown fails to load' do context 'when project dropdown fails to load' do
before do before do
WebMock.stub_request(:get, sentry_list_projects_url) WebMock.stub_request(:get, sentry_list_projects_url)
.to_return( .to_return(
...@@ -155,7 +156,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -155,7 +156,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'integrated error tracking backend' do context 'with integrated error tracking backend' do
it 'successfully fills and submits the form' do it 'successfully fills and submits the form' do
visit project_settings_operations_path(project) visit project_settings_operations_path(project)
...@@ -189,7 +190,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -189,7 +190,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'grafana integration settings form' do describe 'grafana integration settings form' do
it 'successfully fills and completes the form' do it 'successfully fills and completes the form' do
visit project_settings_operations_path(project) visit project_settings_operations_path(project)
......
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