diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-04 06:09:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-04 06:09:57 +0000 |
commit | 704b3dfa40322de43d5b5583ab6782350f3061dc (patch) | |
tree | 4d9aceb89af008e9f1800e6324c17eaf3017c1f8 /spec | |
parent | 777572d30e059848bb60ad34e5a997c248cf5454 (diff) | |
download | gitlab-ce-704b3dfa40322de43d5b5583ab6782350f3061dc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/settings/monitor_settings_spec.rb | 16 | ||||
-rw-r--r-- | spec/frontend/alerts_settings/components/__snapshots__/alerts_form_spec.js.snap (renamed from spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap) | 11 | ||||
-rw-r--r-- | spec/frontend/alerts_settings/components/alerts_form_spec.js (renamed from spec/frontend/incidents_settings/components/alerts_form_spec.js) | 3 | ||||
-rw-r--r-- | spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js | 11 | ||||
-rw-r--r-- | spec/frontend/incidents_settings/components/__snapshots__/incidents_settings_tabs_spec.js.snap | 11 | ||||
-rw-r--r-- | spec/helpers/operations_helper_spec.rb | 18 |
6 files changed, 36 insertions, 34 deletions
diff --git a/spec/features/projects/settings/monitor_settings_spec.rb b/spec/features/projects/settings/monitor_settings_spec.rb index 64138e0aeca..971a747e64f 100644 --- a/spec/features/projects/settings/monitor_settings_spec.rb +++ b/spec/features/projects/settings/monitor_settings_spec.rb @@ -41,7 +41,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do visit project_settings_operations_path(project) wait_for_requests - click_expand_incident_management_button + click_settings_tab end it 'renders form for incident management' do @@ -60,22 +60,24 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do click_on('bug') save_form - click_expand_incident_management_button + click_settings_tab 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 end - def click_expand_incident_management_button - within '.qa-incident-management-settings' do - click_button('Expand') + def click_settings_tab + within '[data-testid="alert-integration-settings"]' do + click_link 'Alert settings' end end def save_form - page.within ".qa-incident-management-settings" do - click_on 'Save changes' + page.within '[data-testid="alert-integration-settings"]' do + click_button 'Save changes' end end end diff --git a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap b/spec/frontend/alerts_settings/components/__snapshots__/alerts_form_spec.js.snap index 505f061703a..3a374084dbc 100644 --- a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap +++ b/spec/frontend/alerts_settings/components/__snapshots__/alerts_form_spec.js.snap @@ -34,16 +34,17 @@ exports[`Alert integration settings form default state should match the default for="alert-integration-settings-issue-template" > - Incident template (optional) + Incident template (optional). <gl-link-stub href="/help/user/project/description_templates#create-an-issue-template" target="_blank" > - <gl-icon-stub - name="question" - size="12" - /> + <span + class="gl-font-weight-normal gl-pl-2" + > + Learn more. + </span> </gl-link-stub> </label> diff --git a/spec/frontend/incidents_settings/components/alerts_form_spec.js b/spec/frontend/alerts_settings/components/alerts_form_spec.js index 2516e8afdfa..a045954dfb8 100644 --- a/spec/frontend/incidents_settings/components/alerts_form_spec.js +++ b/spec/frontend/alerts_settings/components/alerts_form_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import AlertsSettingsForm from '~/incidents_settings/components/alerts_form.vue'; +import AlertsSettingsForm from '~/alerts_settings/components/alerts_form.vue'; describe('Alert integration settings form', () => { let wrapper; @@ -25,7 +25,6 @@ describe('Alert integration settings form', () => { afterEach(() => { if (wrapper) { wrapper.destroy(); - wrapper = null; } }); diff --git a/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js b/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js index 595c3f1a289..1c4dde39585 100644 --- a/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js +++ b/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js @@ -95,6 +95,10 @@ describe('AlertsSettingsWrapper', () => { }, provide: { ...provide, + alertSettings: { + templates: [], + }, + service: {}, }, mocks: { $apollo: { @@ -129,12 +133,17 @@ describe('AlertsSettingsWrapper', () => { wrapper = mount(AlertsSettingsWrapper, { localVue, apolloProvider: fakeApollo, + provide: { + alertSettings: { + templates: [], + }, + service: {}, + }, }); } afterEach(() => { wrapper.destroy(); - wrapper = null; }); describe('template', () => { diff --git a/spec/frontend/incidents_settings/components/__snapshots__/incidents_settings_tabs_spec.js.snap b/spec/frontend/incidents_settings/components/__snapshots__/incidents_settings_tabs_spec.js.snap index e3df488cc47..d859b9f9bd2 100644 --- a/spec/frontend/incidents_settings/components/__snapshots__/incidents_settings_tabs_spec.js.snap +++ b/spec/frontend/incidents_settings/components/__snapshots__/incidents_settings_tabs_spec.js.snap @@ -2,7 +2,7 @@ exports[`IncidentsSettingTabs should render the component 1`] = ` <section - class="settings no-animate qa-incident-management-settings" + class="settings no-animate" data-qa-selector="incidents_settings_content" id="incident-management-settings" > @@ -44,15 +44,6 @@ exports[`IncidentsSettingTabs should render the component 1`] = ` <!----> <gl-tab-stub - title="Alert integration" - titlelinkclass="" - > - <alertssettingsform-stub - class="gl-pt-3" - data-testid="AlertsSettingsForm-tab" - /> - </gl-tab-stub> - <gl-tab-stub title="PagerDuty integration" titlelinkclass="" > diff --git a/spec/helpers/operations_helper_spec.rb b/spec/helpers/operations_helper_spec.rb index 5b0ce00063f..e1bd477bc75 100644 --- a/spec/helpers/operations_helper_spec.rb +++ b/spec/helpers/operations_helper_spec.rb @@ -40,7 +40,14 @@ RSpec.describe OperationsHelper do 'prometheus_url' => notify_project_prometheus_alerts_url(project, format: :json), 'disabled' => 'false', 'project_path' => project.full_path, - 'multi_integrations' => 'false' + 'multi_integrations' => 'false', + 'templates' => '[]', + 'create_issue' => 'false', + 'issue_template_key' => '', + 'send_email' => 'false', + 'auto_close_incident' => 'true', + 'operations_settings_endpoint' => project_settings_operations_path(project), + 'pagerduty_reset_key_path' => reset_pagerduty_token_project_settings_operations_path(project) ) end end @@ -106,9 +113,7 @@ RSpec.describe OperationsHelper do create( :project_incident_management_setting, project: project, - issue_template_key: 'template-key', - pagerduty_active: true, - auto_close_incident: false + pagerduty_active: true ) end @@ -117,11 +122,6 @@ RSpec.describe OperationsHelper do it 'returns the correct set of data' do is_expected.to include( operations_settings_endpoint: project_settings_operations_path(project), - templates: '[]', - create_issue: 'false', - issue_template_key: 'template-key', - send_email: 'false', - auto_close_incident: 'false', pagerduty_active: 'true', pagerduty_token: operations_settings.pagerduty_token, pagerduty_webhook_url: project_incidents_integrations_pagerduty_url(project, token: operations_settings.pagerduty_token), |