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
4e2f8ef1
Commit
4e2f8ef1
authored
Mar 20, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expect GraphQL errors to be an Array
parent
ac4c5ded
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/assets/javascripts/snippets/components/snippet_header.vue
...assets/javascripts/snippets/components/snippet_header.vue
+1
-1
spec/frontend/snippets/components/snippet_header_spec.js
spec/frontend/snippets/components/snippet_header_spec.js
+3
-1
No files found.
app/assets/javascripts/snippets/components/snippet_header.vue
View file @
4e2f8ef1
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
variables
:
{
id
:
this
.
snippet
.
id
},
variables
:
{
id
:
this
.
snippet
.
id
},
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
if
(
data
?.
destroySnippet
?.
errors
)
{
if
(
data
?.
destroySnippet
?.
errors
.
length
)
{
throw
new
Error
(
data
?.
destroySnippet
?.
errors
[
0
]);
throw
new
Error
(
data
?.
destroySnippet
?.
errors
[
0
]);
}
}
this
.
isDeleting
=
false
;
this
.
isDeleting
=
false
;
...
...
spec/frontend/snippets/components/snippet_header_spec.js
View file @
4e2f8ef1
...
@@ -32,7 +32,9 @@ describe('Snippet header component', () => {
...
@@ -32,7 +32,9 @@ describe('Snippet header component', () => {
const
errorMsg
=
'
Foo bar
'
;
const
errorMsg
=
'
Foo bar
'
;
const
err
=
{
message
:
errorMsg
};
const
err
=
{
message
:
errorMsg
};
const
resolveMutate
=
jest
.
fn
(()
=>
Promise
.
resolve
({
data
:
{}
}));
const
resolveMutate
=
jest
.
fn
(()
=>
Promise
.
resolve
({
data
:
{
destroySnippet
:
{
errors
:
[]
}
}
}),
);
const
rejectMutation
=
jest
.
fn
(()
=>
Promise
.
reject
(
err
));
const
rejectMutation
=
jest
.
fn
(()
=>
Promise
.
reject
(
err
));
const
mutationTypes
=
{
const
mutationTypes
=
{
...
...
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