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
3a46ff4e
Commit
3a46ff4e
authored
Dec 20, 2021
by
Fernando Arias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit test for package_api axios call change
* Test that axios is called properly
parent
83b23942
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
spec/frontend/api/packages_api_spec.js
spec/frontend/api/packages_api_spec.js
+8
-3
No files found.
spec/frontend/api/packages_api_spec.js
View file @
3a46ff4e
...
...
@@ -38,12 +38,17 @@ describe('Api', () => {
mock
.
onPut
(
expectedUrl
).
replyOnce
(
httpStatus
.
OK
,
apiResponse
);
return
publishPackage
(
{
projectPath
,
name
,
version
:
0
,
fileName
:
name
,
files
:
[{}]
},
{
projectPath
,
name
,
version
:
0
,
fileName
:
name
,
files
:
[
new
File
([
'
zip contents
'
],
'
bar.zip
'
)],
},
{
status
:
'
hidden
'
,
select
:
'
package_file
'
},
).
then
(({
data
})
=>
{
expect
(
data
).
toEqual
(
apiResponse
);
expect
(
axios
.
put
).
toHaveBeenCalledWith
(
expectedUrl
,
expect
.
any
(
FormData
),
{
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
},
expect
(
axios
.
put
).
toHaveBeenCalledWith
(
expectedUrl
,
expect
.
any
(
File
),
{
params
:
{
select
:
'
package_file
'
,
status
:
'
hidden
'
},
});
});
...
...
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