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
38ba70e1
Commit
38ba70e1
authored
Mar 16, 2021
by
pburdette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix has artifacts
Fix the computed property to take account for the locked property.
parent
9fce767d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
app/assets/javascripts/jobs/components/sidebar.vue
app/assets/javascripts/jobs/components/sidebar.vue
+2
-1
spec/frontend/jobs/components/sidebar_spec.js
spec/frontend/jobs/components/sidebar_spec.js
+30
-0
spec/frontend/jobs/mock_data.js
spec/frontend/jobs/mock_data.js
+3
-0
No files found.
app/assets/javascripts/jobs/components/sidebar.vue
View file @
38ba70e1
...
...
@@ -49,7 +49,8 @@ export default {
return
this
.
job
.
status
&&
this
.
job
.
recoverable
?
'
primary
'
:
'
secondary
'
;
},
hasArtifact
()
{
return
!
isEmpty
(
this
.
job
.
artifact
);
// the artifact object will always have a locked property
return
Object
.
keys
(
this
.
job
.
artifact
).
length
>
1
;
},
hasTriggers
()
{
return
!
isEmpty
(
this
.
job
.
trigger
);
...
...
spec/frontend/jobs/components/sidebar_spec.js
View file @
38ba70e1
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
ArtifactsBlock
from
'
~/jobs/components/artifacts_block.vue
'
;
import
JobRetryForwardDeploymentModal
from
'
~/jobs/components/job_retry_forward_deployment_modal.vue
'
;
import
JobRetryButton
from
'
~/jobs/components/job_sidebar_retry_button.vue
'
;
import
JobsContainer
from
'
~/jobs/components/jobs_container.vue
'
;
...
...
@@ -14,6 +15,7 @@ describe('Sidebar details block', () => {
const
forwardDeploymentFailure
=
'
forward_deployment_failure
'
;
const
findModal
=
()
=>
wrapper
.
find
(
JobRetryForwardDeploymentModal
);
const
findArtifactsBlock
=
()
=>
wrapper
.
findComponent
(
ArtifactsBlock
);
const
findCancelButton
=
()
=>
wrapper
.
findByTestId
(
'
cancel-button
'
);
const
findNewIssueButton
=
()
=>
wrapper
.
findByTestId
(
'
job-new-issue
'
);
const
findRetryButton
=
()
=>
wrapper
.
find
(
JobRetryButton
);
...
...
@@ -21,6 +23,9 @@ describe('Sidebar details block', () => {
const
createWrapper
=
({
props
=
{}
}
=
{})
=>
{
store
=
createStore
();
store
.
state
.
job
=
job
;
wrapper
=
extendedWrapper
(
shallowMount
(
Sidebar
,
{
...
props
,
...
...
@@ -164,4 +169,29 @@ describe('Sidebar details block', () => {
});
});
});
describe
(
'
artifacts
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
();
});
it
(
'
artifacts are not shown if there are no properties other than locked
'
,
()
=>
{
expect
(
findArtifactsBlock
().
exists
()).
toBe
(
false
);
});
it
(
'
artifacts are shown if present
'
,
async
()
=>
{
store
.
state
.
job
.
artifact
=
{
download_path
:
'
/root/ci-project/-/jobs/1960/artifacts/download
'
,
browse_path
:
'
/root/ci-project/-/jobs/1960/artifacts/browse
'
,
keep_path
:
'
/root/ci-project/-/jobs/1960/artifacts/keep
'
,
expire_at
:
'
2021-03-23T17:57:11.211Z
'
,
expired
:
false
,
locked
:
false
,
};
await
wrapper
.
vm
.
$nextTick
();
expect
(
findArtifactsBlock
().
exists
()).
toBe
(
true
);
});
});
});
spec/frontend/jobs/mock_data.js
View file @
38ba70e1
...
...
@@ -911,6 +911,9 @@ export const stages = [
export
default
{
id
:
4757
,
artifact
:
{
locked
:
false
,
},
name
:
'
test
'
,
build_path
:
'
/root/ci-mock/-/jobs/4757
'
,
retry_path
:
'
/root/ci-mock/-/jobs/4757/retry
'
,
...
...
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