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
78136c0d
Commit
78136c0d
authored
May 15, 2020
by
Nick Kipling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small adjustments as per feedback
Removed $nextTick in test Added test for checking if versions don't exist
parent
c3e32c8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
ee/spec/frontend/packages/details/components/app_spec.js
ee/spec/frontend/packages/details/components/app_spec.js
+2
-3
ee/spec/frontend/packages/details/store/actions_spec.js
ee/spec/frontend/packages/details/store/actions_spec.js
+23
-0
No files found.
ee/spec/frontend/packages/details/components/app_spec.js
View file @
78136c0d
...
...
@@ -178,11 +178,10 @@ describe('PackagesApp', () => {
it
(
'
makes api request on first click of tab
'
,
()
=>
{
const
apiMethodSpy
=
jest
.
spyOn
(
wrapper
.
vm
,
'
fetchPackageVersions
'
);
versionsTab
().
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
apiMethodSpy
).
toHaveBeenCalled
();
});
expect
(
apiMethodSpy
).
toHaveBeenCalled
();
});
});
...
...
ee/spec/frontend/packages/details/store/actions_spec.js
View file @
78136c0d
...
...
@@ -34,6 +34,25 @@ describe('Actions Package details store', () => {
);
});
it
(
"
does not set the versions if they don't exist
"
,
done
=>
{
Api
.
projectPackage
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
packageEntity
,
versions
:
null
}
});
testAction
(
actions
.
fetchPackageVersions
,
undefined
,
{
packageEntity
},
[{
type
:
types
.
SET_LOADING
,
payload
:
true
},
{
type
:
types
.
SET_LOADING
,
payload
:
false
}],
[],
()
=>
{
expect
(
Api
.
projectPackage
).
toHaveBeenCalledWith
(
packageEntity
.
project_id
,
packageEntity
.
id
,
);
done
();
},
);
});
it
(
'
should create flash on API error
'
,
done
=>
{
Api
.
projectPackage
=
jest
.
fn
().
mockRejectedValue
();
...
...
@@ -44,6 +63,10 @@ describe('Actions Package details store', () => {
[{
type
:
types
.
SET_LOADING
,
payload
:
true
},
{
type
:
types
.
SET_LOADING
,
payload
:
false
}],
[],
()
=>
{
expect
(
Api
.
projectPackage
).
toHaveBeenCalledWith
(
packageEntity
.
project_id
,
packageEntity
.
id
,
);
expect
(
createFlash
).
toHaveBeenCalledWith
(
FETCH_PACKAGE_VERSIONS_ERROR
);
done
();
},
...
...
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