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
a7d06d42
Commit
a7d06d42
authored
Apr 22, 2021
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linking url creation of incident
- add tests
parent
2c056e66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
ee/app/assets/javascripts/threat_monitoring/components/alerts/alerts_list.vue
...ripts/threat_monitoring/components/alerts/alerts_list.vue
+7
-1
ee/spec/frontend/threat_monitoring/components/alerts/alerts_list_spec.js
...d/threat_monitoring/components/alerts/alerts_list_spec.js
+21
-7
No files found.
ee/app/assets/javascripts/threat_monitoring/components/alerts/alerts_list.vue
View file @
a7d06d42
...
...
@@ -131,7 +131,13 @@ export default {
getIssueMeta
({
issue
:
{
iid
,
state
}
})
{
return
{
state
:
state
===
'
closed
'
?
`(
${
this
.
$options
.
i18n
.
CLOSED
}
)`
:
''
,
link
:
joinPaths
(
gon
.
relative_url_root
,
'
issues/incident
'
,
iid
),
link
:
joinPaths
(
gon
.
relative_url_root
||
'
/
'
,
this
.
projectPath
,
'
-
'
,
'
issues/incident
'
,
iid
,
),
};
},
handleAlertError
(
msg
)
{
...
...
ee/spec/frontend/threat_monitoring/components/alerts/alerts_list_spec.js
View file @
a7d06d42
...
...
@@ -45,8 +45,7 @@ describe('AlertsList component', () => {
const
findIdColumn
=
()
=>
wrapper
.
findByTestId
(
'
threat-alerts-id
'
);
const
findEventCountColumn
=
()
=>
wrapper
.
findByTestId
(
'
threat-alerts-event-count
'
);
const
findIssueColumn
=
()
=>
wrapper
.
findByTestId
(
'
threat-alerts-issue
'
);
const
findIssueColumnTextAt
=
(
id
)
=>
wrapper
.
findAllByTestId
(
'
threat-alerts-issue
'
).
at
(
id
).
text
();
const
findIssueColumnAt
=
(
id
)
=>
wrapper
.
findAllByTestId
(
'
threat-alerts-issue
'
).
at
(
id
);
const
findStatusColumn
=
()
=>
wrapper
.
findComponent
(
AlertStatus
);
const
findStatusColumnHeader
=
()
=>
wrapper
.
findByTestId
(
'
threat-alerts-status-header
'
);
const
findEmptyState
=
()
=>
wrapper
.
findByTestId
(
'
threat-alerts-empty-state
'
);
...
...
@@ -182,11 +181,26 @@ describe('AlertsList component', () => {
});
it
.
each
`
description | id | text
${
'
when an issue is created and is open
'
}
|
${
0
}
|
${
'
#5
'
}
${
'
when an issue is created and is closed
'
}
|
${
1
}
|
${
'
#6 (closed)
'
}
`
(
'
displays the correct text $description
'
,
({
id
,
text
})
=>
{
expect
(
findIssueColumnTextAt
(
id
)).
toBe
(
text
);
description | id | text | link
${
'
when an issue is created and is open
'
}
|
${
0
}
|
${
'
#5
'
}
|
${
'
/#/-/issues/incident/5
'
}
${
'
when an issue is created and is closed
'
}
|
${
1
}
|
${
'
#6 (closed)
'
}
|
${
'
/#/-/issues/incident/6
'
}
`
(
'
displays the correct text $description
'
,
({
id
,
text
,
link
})
=>
{
expect
(
findIssueColumnAt
(
id
).
text
()).
toBe
(
text
);
expect
(
findIssueColumnAt
(
id
).
attributes
(
'
href
'
)).
toBe
(
link
);
});
describe
(
'
gon.relative_url_root
'
,
()
=>
{
beforeAll
(()
=>
{
gon
.
relative_url_root
=
'
/test
'
;
});
afterEach
(()
=>
{
gon
.
relative_url_root
=
''
;
});
it
(
'
creates the correct href when the gon.relative_url_root is set
'
,
()
=>
{
expect
(
findIssueColumnAt
(
0
).
attributes
(
'
href
'
)).
toBe
(
'
/test/#/-/issues/incident/5
'
);
});
});
});
});
...
...
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