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
3b50eec9
Commit
3b50eec9
authored
May 05, 2020
by
pburdette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor artifact spec
Spec now searches for GlLinks and I added another mock artifact to props data.
parent
08ff94cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
app/assets/javascripts/pipelines/components/pipelines_artifacts.vue
.../javascripts/pipelines/components/pipelines_artifacts.vue
+1
-1
spec/frontend/pipelines/pipelines_artifacts_spec.js
spec/frontend/pipelines/pipelines_artifacts_spec.js
+7
-2
No files found.
app/assets/javascripts/pipelines/components/pipelines_artifacts.vue
View file @
3b50eec9
...
...
@@ -33,7 +33,7 @@ export default {
<i
class=
"fa fa-caret-down"
aria-hidden=
"true"
></i>
</button>
<ul
class=
"dropdown-menu dropdown-menu-right"
>
<li
v-for=
"(artifact, i) in artifacts"
:key=
"i"
data-testid=
"artifact"
>
<li
v-for=
"(artifact, i) in artifacts"
:key=
"i"
>
<gl-link
:href=
"artifact.path"
rel=
"nofollow"
download
>
Download
{{
artifact
.
name
}}
artifacts
</gl-link
>
...
...
spec/frontend/pipelines/pipelines_artifacts_spec.js
View file @
3b50eec9
...
...
@@ -13,12 +13,17 @@ describe('Pipelines Artifacts dropdown', () => {
name
:
'
artifact
'
,
path
:
'
/download/path
'
,
},
{
name
:
'
artifact two
'
,
path
:
'
/download/path-two
'
,
},
],
},
});
};
const
findGlLink
=
()
=>
wrapper
.
find
(
GlLink
);
const
findAllGlLinks
=
()
=>
wrapper
.
find
(
'
.dropdown-menu
'
).
findAll
(
GlLink
);
beforeEach
(()
=>
{
createComponent
();
...
...
@@ -29,8 +34,8 @@ describe('Pipelines Artifacts dropdown', () => {
wrapper
=
null
;
});
it
(
'
should render a dropdown with the provided artifacts
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
[data-testid="artifact"]
'
)).
toHaveLength
(
1
);
it
(
'
should render a dropdown with
all
the provided artifacts
'
,
()
=>
{
expect
(
findAllGlLinks
()).
toHaveLength
(
2
);
});
it
(
'
should render a link with the provided path
'
,
()
=>
{
...
...
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