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
4b544817
Commit
4b544817
authored
Nov 23, 2019
by
lauraMon
Committed by
Martin Wortschack
Dec 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates rspec and variable
parent
38151e68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
24 deletions
+19
-24
app/assets/javascripts/error_tracking/components/error_details.vue
...s/javascripts/error_tracking/components/error_details.vue
+2
-2
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+14
-19
spec/helpers/projects/error_tracking_helper_spec.rb
spec/helpers/projects/error_tracking_helper_spec.rb
+3
-3
No files found.
app/assets/javascripts/error_tracking/components/error_details.vue
View file @
4b544817
...
...
@@ -66,7 +66,7 @@ export default {
showStacktrace
()
{
return
Boolean
(
!
this
.
loadingStacktrace
&&
this
.
stacktrace
&&
this
.
stacktrace
.
length
);
},
error
Title
()
{
issue
Title
()
{
return
`
${
this
.
error
.
title
}
`
;
},
errorUrl
()
{
...
...
@@ -139,7 +139,7 @@ export default {
<div
class=
"top-area align-items-center justify-content-between py-3"
>
<span
v-if=
"!loadingStacktrace && stacktrace"
v-html=
"reported"
></span>
<form
ref=
"sentryIssueForm"
:action=
"projectIssuesPath"
method=
"POST"
>
<input
name=
"issue[title]"
:value=
"
error
Title"
type=
"hidden"
/>
<input
name=
"issue[title]"
:value=
"
issue
Title"
type=
"hidden"
/>
<input
name=
"issue[description]"
:value=
"issueDescription"
type=
"hidden"
/>
<input
:value=
"csrfToken"
type=
"hidden"
name=
"authenticity_token"
/>
<gl-button
variant=
"success"
@
click=
"createIssue"
>
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
4b544817
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
Gl
Button
,
Gl
LoadingIcon
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlLink
}
from
'
@gitlab/ui
'
;
import
Stacktrace
from
'
~/error_tracking/components/stacktrace.vue
'
;
import
ErrorDetails
from
'
~/error_tracking/components/error_details.vue
'
;
...
...
@@ -20,7 +20,8 @@ describe('ErrorDetails', () => {
propsData
:
{
issueDetailsPath
:
'
/123/details
'
,
issueStackTracePath
:
'
/stacktrace
'
,
issueProjectPath
:
'
/test-project/issues/new
'
,
projectIssuesPath
:
'
/test-project/issues/
'
,
csrfToken
:
'
fakeToken
'
,
},
});
}
...
...
@@ -83,7 +84,7 @@ describe('ErrorDetails', () => {
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
false
);
});
it
(
'
should
allow an issue to be created
with title and description
'
,
()
=>
{
it
(
'
should
create an issue
with title and description
'
,
()
=>
{
store
.
state
.
details
.
loading
=
false
;
store
.
state
.
details
.
error
=
{
id
:
1
,
...
...
@@ -95,22 +96,16 @@ describe('ErrorDetails', () => {
user_count
:
2
,
};
mountComponent
();
const
button
=
wrapper
.
find
(
GlButton
);
const
title
=
'
Issue title
'
;
const
url
=
'
Sentry event: http://sentry.gitlab.net/gitlab
'
;
const
firstSeen
=
'
First seen: 2017-05-26T13:32:48Z
'
;
const
lastSeen
=
'
Last seen: 2018-05-26T13:32:48Z
'
;
const
count
=
'
Events: 12
'
;
const
userCount
=
'
Users: 2
'
;
const
issueDescription
=
`
${
url
}${
firstSeen
}${
lastSeen
}${
count
}${
userCount
}
`
;
const
issueLink
=
`/test-project/issues/new?issue[title]=
${
encodeURIComponent
(
title
,
)}
&issue[description]=
${
encodeURIComponent
(
issueDescription
)}
`
;
expect
(
button
.
exists
()).
toBe
(
true
);
expect
(
button
.
attributes
().
href
).
toBe
(
issueLink
);
const
form
=
wrapper
.
find
({
ref
:
'
sentryIssueForm
'
});
const
csrfTokenInput
=
wrapper
.
find
(
'
input[name="authenticity_token"]
'
);
const
issueTitleInput
=
wrapper
.
find
(
'
input[name="issue[title]"]
'
);
const
issueDescriptionInput
=
wrapper
.
find
(
'
input[name="issue[description]"]
'
);
expect
(
form
).
toExist
();
expect
(
csrfTokenInput
.
attributes
(
'
value
'
)).
toBe
(
'
fakeToken
'
);
expect
(
issueTitleInput
.
attributes
(
'
value
'
)).
toContain
(
wrapper
.
vm
.
issueTitle
);
expect
(
issueDescriptionInput
.
attributes
(
'
value
'
)).
toContain
(
wrapper
.
vm
.
issueDescription
);
});
describe
(
'
Stacktrace
'
,
()
=>
{
...
...
spec/helpers/projects/error_tracking_helper_spec.rb
View file @
4b544817
...
...
@@ -81,7 +81,7 @@ describe Projects::ErrorTrackingHelper do
let
(
:route_params
)
{
[
project
.
owner
,
project
,
issue_id
,
{
format: :json
}]
}
let
(
:details_path
)
{
details_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:stack_trace_path
)
{
stack_trace_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:issue
_project_path
)
{
new_project_issue
_path
(
project
)
}
let
(
:issue
s_path
)
{
project_issues
_path
(
project
)
}
let
(
:result
)
{
helper
.
error_details_data
(
project
,
issue_id
)
}
...
...
@@ -93,8 +93,8 @@ describe Projects::ErrorTrackingHelper do
expect
(
result
[
'issue-stack-trace-path'
]).
to
eq
stack_trace_path
end
it
'
returns the correct path for creating a new issu
e'
do
expect
(
result
[
'
issue-project-path'
]).
to
eq
issue_project
_path
it
'
creates an issue and redirects to issue show pag
e'
do
expect
(
result
[
'
project-issues-path'
]).
to
eq
issues
_path
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