Commit a89ba59b authored by Miguel Rincon's avatar Miguel Rincon

Merge branch...

Merge branch '334981-an-error-occurred-fetching-the-status-checks-when-viewing-project-settings' into 'master'

Add license flag to status checks settings

See merge request gitlab-org/gitlab!65246
parents 8664dd3a f9f6f513
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= render_ce 'projects/merge_request_merge_checks_settings', project: @project, form: form = render_ce 'projects/merge_request_merge_checks_settings', project: @project, form: form
- if ::Feature.enabled?(:ff_external_status_checks, @project, default_enabled: :yaml) - if ::Feature.enabled?(:ff_external_status_checks, @project, default_enabled: :yaml) && @project.licensed_feature_available?(:external_status_checks)
= render_if_exists 'projects/merge_request_status_checks_settings' = render_if_exists 'projects/merge_request_status_checks_settings'
= render 'projects/merge_request_merge_suggestions_settings', project: @project, form: form = render 'projects/merge_request_merge_suggestions_settings', project: @project, form: form
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
%p.text-secondary %p.text-secondary
= s_('ProjectSettings|Used for every new merge request.') = s_('ProjectSettings|Used for every new merge request.')
- create_a_merge_request_template_help_link_url = help_page_path('user/project/description_templates', anchor: 'create-a-merge-request-template') - create_a_merge_request_template_help_link_url = help_page_path('user/project/description_templates', anchor: 'create-a-merge-request-template')
- create_a_merge_request_templates_elp_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: create_a_merge_request_template_help_link_url } - create_a_merge_request_templates_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: create_a_merge_request_template_help_link_url }
= s_('ProjectSettings|%{link_start}What are description templates?%{link_end}').html_safe % { link_start: create_a_merge_request_templates_elp_link_start, link_end: '</a>'.html_safe } = s_('ProjectSettings|%{link_start}What are description templates?%{link_end}').html_safe % { link_start: create_a_merge_request_templates_help_link_start, link_end: '</a>'.html_safe }
= form.text_area :merge_requests_template, class: "form-control", rows: 3, data: { qa_selector: 'default_merge_request_template_field' } = form.text_area :merge_requests_template, class: "form-control", rows: 3, data: { qa_selector: 'default_merge_request_template_field' }
......
...@@ -17,6 +17,21 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do ...@@ -17,6 +17,21 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
end end
context 'Status checks' do context 'Status checks' do
context 'Feature flag is disabled' do
before do
stub_feature_flags(ff_external_status_checks: false)
end
it 'does not render the status checks area' do
expect(page).not_to have_selector('[data-testid="status-checks-table"]')
end
end
context 'Feature flag is enabled' do
before do
stub_feature_flags(ff_external_status_checks: true)
end
context 'Feature is not available' do context 'Feature is not available' do
before do before do
stub_licensed_features(external_status_checks: false) stub_licensed_features(external_status_checks: false)
...@@ -92,6 +107,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do ...@@ -92,6 +107,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
end end
end end
end end
end
context 'Issuable default templates' do context 'Issuable default templates' do
context 'Feature is not available' do context 'Feature is not available' do
......
...@@ -16,21 +16,26 @@ RSpec.describe 'projects/edit' do ...@@ -16,21 +16,26 @@ RSpec.describe 'projects/edit' do
end end
context 'status checks' do context 'status checks' do
context 'feature enabled' do context 'feature flag is disabled' do
before do before do
stub_feature_flags(ff_external_status_checks: true) stub_feature_flags(ff_external_status_checks: false)
render render
end end
it 'shows the status checks area' do it 'hides the status checks area' do
expect(rendered).to have_content('Status check') expect(rendered).not_to have_content('Status check')
end end
end end
context 'feature disabled' do context 'feature flag is enabled' do
before do before do
stub_feature_flags(ff_external_status_checks: false) stub_feature_flags(ff_external_status_checks: true)
end
context 'feature is not available' do
before do
stub_licensed_features(external_status_checks: false)
render render
end end
...@@ -39,5 +44,18 @@ RSpec.describe 'projects/edit' do ...@@ -39,5 +44,18 @@ RSpec.describe 'projects/edit' do
expect(rendered).not_to have_content('Status check') expect(rendered).not_to have_content('Status check')
end end
end end
context 'feature is available' do
before do
stub_licensed_features(external_status_checks: true)
render
end
it 'shows the status checks area' do
expect(rendered).to have_content('Status check')
end
end
end
end end
end end
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