Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0678a49a
Commit
0678a49a
authored
Jun 25, 2021
by
Tristan Read
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error when loading incident issue with alert
Changelog: fixed
parent
87fd9807
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
app/assets/javascripts/issue_show/components/incidents/graphql/queries/get_alert.graphql
...ow/components/incidents/graphql/queries/get_alert.graphql
+1
-0
spec/features/issues/incident_issue_spec.rb
spec/features/issues/incident_issue_spec.rb
+43
-6
No files found.
app/assets/javascripts/issue_show/components/incidents/graphql/queries/get_alert.graphql
View file @
0678a49a
query
getAlert
(
$iid
:
String
!,
$fullPath
:
ID
!)
{
query
getAlert
(
$iid
:
String
!,
$fullPath
:
ID
!)
{
project
(
fullPath
:
$fullPath
)
{
project
(
fullPath
:
$fullPath
)
{
issue
(
iid
:
$iid
)
{
issue
(
iid
:
$iid
)
{
id
alertManagementAlert
{
alertManagementAlert
{
iid
iid
title
title
...
...
spec/features/issues/incident_issue_spec.rb
View file @
0678a49a
...
@@ -3,21 +3,58 @@
...
@@ -3,21 +3,58 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'Incident Detail'
,
:js
do
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
context
'when user displays the incident'
do
it
'shows the incident tabs'
do
before
do
project
=
create
(
:project
,
:public
)
project
.
add_developer
(
user
)
incident
=
create
(
:incident
,
project:
project
,
description:
'hello'
)
sign_in
(
user
)
visit
project_issue_path
(
project
,
incident
)
visit
project_issue_path
(
project
,
incident
)
wait_for_requests
wait_for_requests
end
it
'shows incident and alert data'
do
page
.
within
(
'.issuable-details'
)
do
page
.
within
(
'.issuable-details'
)
do
incident_tabs
=
find
(
'[data-testid="incident-tabs"]'
)
incident_tabs
=
find
(
'[data-testid="incident-tabs"]'
)
aggregate_failures
'shows title and Summary tab'
do
expect
(
find
(
'h2'
)).
to
have_content
(
incident
.
title
)
expect
(
find
(
'h2'
)).
to
have_content
(
incident
.
title
)
expect
(
incident_tabs
).
to
have_content
(
'Summary'
)
expect
(
incident_tabs
).
to
have_content
(
'Summary'
)
expect
(
incident_tabs
).
to
have_content
(
incident
.
description
)
expect
(
incident_tabs
).
to
have_content
(
incident
.
description
)
end
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
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment