diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-25 15:08:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-25 15:08:34 +0000 |
commit | 8968ab7b21d7bcb55a56f9bf66e3ac66106ddad7 (patch) | |
tree | dea3721d9a48a8f6e9084d3eb44527a5e0a3c9d5 /spec | |
parent | 5005c6e61f4d04cb6ad155b3910461cc77927dc3 (diff) | |
download | gitlab-ce-8968ab7b21d7bcb55a56f9bf66e3ac66106ddad7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues/incident_issue_spec.rb | 49 | ||||
-rw-r--r-- | spec/frontend/repository/components/table/__snapshots__/row_spec.js.snap | 3 |
2 files changed, 46 insertions, 6 deletions
diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb index d004ee85dd8..3033a138551 100644 --- a/spec/features/issues/incident_issue_spec.rb +++ b/spec/features/issues/incident_issue_spec.rb @@ -3,20 +3,57 @@ require 'spec_helper' RSpec.describe 'Incident Detail', :js do + let_it_be(:project) { create(:project, :public) } + let_it_be(:payload) do + { + 'title' => 'Alert title', + 'start_time' => '2020-04-27T10:10:22.265949279Z', + 'custom' => { + 'alert' => { + 'fields' => %w[one two] + } + }, + 'yet' => { + 'another' => 73 + } + } + end + + let_it_be(:user) { create(:user) } + let_it_be(:started_at) { Time.now.rfc3339 } + let_it_be(:alert) { create(:alert_management_alert, project: project, payload: payload, started_at: started_at) } + let_it_be(:incident) { create(:incident, project: project, description: 'hello', alert_management_alert: alert) } + context 'when user displays the incident' do - it 'shows the incident tabs' do - project = create(:project, :public) - incident = create(:incident, project: project, description: 'hello') + before do + project.add_developer(user) + sign_in(user) visit project_issue_path(project, incident) wait_for_requests + end + it 'shows incident and alert data' do page.within('.issuable-details') do incident_tabs = find('[data-testid="incident-tabs"]') - expect(find('h2')).to have_content(incident.title) - expect(incident_tabs).to have_content('Summary') - expect(incident_tabs).to have_content(incident.description) + aggregate_failures 'shows title and Summary tab' do + expect(find('h2')).to have_content(incident.title) + expect(incident_tabs).to have_content('Summary') + expect(incident_tabs).to have_content(incident.description) + end + + aggregate_failures 'shows the incident highlight bar' do + expect(incident_tabs).to have_content('Alert events: 1') + expect(incident_tabs).to have_content('Original alert: #1') + end + + aggregate_failures 'shows the Alert details tab' do + click_link 'Alert details' + + expect(incident_tabs).to have_content('"title": "Alert title"') + expect(incident_tabs).to have_content('"yet.another": 73') + end end end end diff --git a/spec/frontend/repository/components/table/__snapshots__/row_spec.js.snap b/spec/frontend/repository/components/table/__snapshots__/row_spec.js.snap index ac60fc4917d..6f461f4c69b 100644 --- a/spec/frontend/repository/components/table/__snapshots__/row_spec.js.snap +++ b/spec/frontend/repository/components/table/__snapshots__/row_spec.js.snap @@ -11,6 +11,7 @@ exports[`Repository table row component renders a symlink table row 1`] = ` class="tree-item-link str-truncated" data-qa-selector="file_name_link" href="https://test.com" + title="test" > <file-icon-stub class="mr-1 position-relative text-secondary" @@ -64,6 +65,7 @@ exports[`Repository table row component renders table row 1`] = ` class="tree-item-link str-truncated" data-qa-selector="file_name_link" href="https://test.com" + title="test" > <file-icon-stub class="mr-1 position-relative text-secondary" @@ -117,6 +119,7 @@ exports[`Repository table row component renders table row for path with special class="tree-item-link str-truncated" data-qa-selector="file_name_link" href="https://test.com" + title="test" > <file-icon-stub class="mr-1 position-relative text-secondary" |