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
e8142784
Commit
e8142784
authored
Feb 26, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates specs for button
parent
8f95de86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+18
-11
No files found.
spec/frontend/error_tracking/components/error_details_spec.js
View file @
e8142784
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
GlLoadingIcon
,
GlLink
,
GlBadge
,
GlFormInput
,
GlAlert
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
{
GlButton
,
GlLoadingIcon
,
GlLink
,
GlBadge
,
GlFormInput
,
GlAlert
,
GlSprintf
,
}
from
'
@gitlab/ui
'
;
import
Stacktrace
from
'
~/error_tracking/components/stacktrace.vue
'
;
import
ErrorDetails
from
'
~/error_tracking/components/error_details.vue
'
;
import
{
...
...
@@ -28,7 +35,7 @@ describe('ErrorDetails', () => {
function
mountComponent
()
{
wrapper
=
shallowMount
(
ErrorDetails
,
{
stubs
:
{
Loading
Button
,
GlSprintf
},
stubs
:
{
Gl
Button
,
GlSprintf
},
localVue
,
store
,
mocks
,
...
...
@@ -127,7 +134,7 @@ describe('ErrorDetails', () => {
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
Stacktrace
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlBadge
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
findAll
(
'
button
'
).
length
).
toBe
(
3
);
expect
(
wrapper
.
findAll
(
GlButton
).
length
).
toBe
(
3
);
});
describe
(
'
Badges
'
,
()
=>
{
...
...
@@ -226,7 +233,7 @@ describe('ErrorDetails', () => {
it
(
'
should submit the form
'
,
()
=>
{
window
.
HTMLFormElement
.
prototype
.
submit
=
()
=>
{};
const
submitSpy
=
jest
.
spyOn
(
wrapper
.
vm
.
$refs
.
sentryIssueForm
,
'
submit
'
);
wrapper
.
find
(
'
[data-qa-selector="create_issue_button"]
'
).
trigger
(
'
click
'
);
wrapper
.
find
(
'
[data-qa-selector="create_issue_button"]
'
).
vm
.
$emit
(
'
click
'
);
expect
(
submitSpy
).
toHaveBeenCalled
();
submitSpy
.
mockRestore
();
});
...
...
@@ -255,14 +262,14 @@ describe('ErrorDetails', () => {
});
it
(
'
marks error as ignored when ignore button is clicked
'
,
()
=>
{
findUpdateIgnoreStatusButton
().
trigger
(
'
click
'
);
findUpdateIgnoreStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateIgnoreStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
IGNORED
}),
);
});
it
(
'
marks error as resolved when resolve button is clicked
'
,
()
=>
{
findUpdateResolveStatusButton
().
trigger
(
'
click
'
);
findUpdateResolveStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateResolveStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
RESOLVED
}),
);
...
...
@@ -281,14 +288,14 @@ describe('ErrorDetails', () => {
});
it
(
'
marks error as unresolved when ignore button is clicked
'
,
()
=>
{
findUpdateIgnoreStatusButton
().
trigger
(
'
click
'
);
findUpdateIgnoreStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateIgnoreStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
UNRESOLVED
}),
);
});
it
(
'
marks error as resolved when resolve button is clicked
'
,
()
=>
{
findUpdateResolveStatusButton
().
trigger
(
'
click
'
);
findUpdateResolveStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateResolveStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
RESOLVED
}),
);
...
...
@@ -307,14 +314,14 @@ describe('ErrorDetails', () => {
});
it
(
'
marks error as ignored when ignore button is clicked
'
,
()
=>
{
findUpdateIgnoreStatusButton
().
trigger
(
'
click
'
);
findUpdateIgnoreStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateIgnoreStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
IGNORED
}),
);
});
it
(
'
marks error as unresolved when unresolve button is clicked
'
,
()
=>
{
findUpdateResolveStatusButton
().
trigger
(
'
click
'
);
findUpdateResolveStatusButton
().
vm
.
$emit
(
'
click
'
);
expect
(
actions
.
updateResolveStatus
.
mock
.
calls
[
0
][
1
]).
toEqual
(
expect
.
objectContaining
({
status
:
errorStatus
.
UNRESOLVED
}),
);
...
...
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