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
f2212234
Commit
f2212234
authored
Jun 18, 2021
by
Jannik Lehmann
Committed by
Kushal Pandya
Jun 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintroduce text on Pipeline Widget dropdown
parent
c54a30c1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
16 deletions
+67
-16
app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/merge_request_artifact_download.vue
...ts/artifact_downloads/merge_request_artifact_download.vue
+1
-0
app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue
..._reports/components/security_report_download_dropdown.vue
+12
-1
app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue
...ipts/vue_shared/security_reports/security_reports_app.vue
+2
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download.vue
...ponents/artifact_downloads/pipeline_artifact_download.vue
+1
-0
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download_spec.js
...nts/artifact_downloads/pipeline_artifact_download_spec.js
+2
-2
spec/frontend/vue_shared/components/security_reports/artifact_downloads/merge_request_artifact_download_spec.js
...rtifact_downloads/merge_request_artifact_download_spec.js
+2
-2
spec/frontend/vue_shared/security_reports/components/security_report_download_dropdown_spec.js
...orts/components/security_report_download_dropdown_spec.js
+32
-5
spec/frontend/vue_shared/security_reports/mock_data.js
spec/frontend/vue_shared/security_reports/mock_data.js
+10
-1
spec/frontend/vue_shared/security_reports/security_reports_app_spec.js
.../vue_shared/security_reports/security_reports_app_spec.js
+5
-5
No files found.
app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/merge_request_artifact_download.vue
View file @
f2212234
...
...
@@ -76,6 +76,7 @@ export default {
<
template
>
<security-report-download-dropdown
:title=
"s__('SecurityReports|Download results')"
:artifacts=
"reportArtifacts"
:loading=
"isLoadingReportArtifacts"
/>
...
...
app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue
View file @
f2212234
...
...
@@ -21,6 +21,16 @@ export default {
required
:
false
,
default
:
false
,
},
text
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
title
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
methods
:
{
artifactText
({
name
})
{
...
...
@@ -35,7 +45,8 @@ export default {
<
template
>
<gl-dropdown
v-gl-tooltip
:text=
"s__('SecurityReports|Download results')"
:text=
"text"
:title=
"title"
:loading=
"loading"
icon=
"download"
size=
"small"
...
...
app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue
View file @
f2212234
...
...
@@ -200,6 +200,7 @@ export default {
<
template
#action-buttons
>
<security-report-download-dropdown
:text=
"s__('SecurityReports|Download results')"
:artifacts=
"reportArtifacts"
:loading=
"isLoadingReportArtifacts"
/>
...
...
@@ -228,6 +229,7 @@ export default {
<
template
#action-buttons
>
<security-report-download-dropdown
:text=
"s__('SecurityReports|Download results')"
:artifacts=
"reportArtifacts"
:loading=
"isLoadingReportArtifacts"
/>
...
...
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download.vue
View file @
f2212234
...
...
@@ -78,6 +78,7 @@ export default {
<div>
<slot
name=
"label"
></slot>
<security-report-download-dropdown
:text=
"s__('SecurityReports|Download results')"
:artifacts=
"reportArtifacts"
:loading=
"isLoadingReportArtifacts"
/>
...
...
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download_spec.js
View file @
f2212234
...
...
@@ -8,7 +8,7 @@ import {
}
from
'
ee/vue_shared/security_reports/constants
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
expectedDownloadDropdownProps
,
expectedDownloadDropdownProps
WithText
,
securityReportPipelineDownloadPathsQueryResponse
,
}
from
'
jest/vue_shared/security_reports/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
...
...
@@ -80,7 +80,7 @@ describe('Pipeline artifact Download', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithText
);
});
});
...
...
spec/frontend/vue_shared/components/security_reports/artifact_downloads/merge_request_artifact_download_spec.js
View file @
f2212234
...
...
@@ -3,7 +3,7 @@ import Vue from 'vue';
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
expectedDownloadDropdownProps
,
expectedDownloadDropdownProps
WithTitle
,
securityReportMergeRequestDownloadPathsQueryResponse
,
}
from
'
jest/vue_shared/security_reports/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
...
...
@@ -80,7 +80,7 @@ describe('Merge request artifact Download', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithTitle
);
});
});
...
...
spec/frontend/vue_shared/security_reports/components/security_report_download_dropdown_spec.js
View file @
f2212234
...
...
@@ -40,14 +40,13 @@ describe('SecurityReportDownloadDropdown component', () => {
expect
(
findDropdown
().
props
(
'
loading
'
)).
toBe
(
false
);
});
it
(
'
renders a dropdown item
s
for each artifact
'
,
()
=>
{
it
(
'
renders a dropdown item for each artifact
'
,
()
=>
{
artifacts
.
forEach
((
artifact
,
i
)
=>
{
const
item
=
findDropdownItems
().
at
(
i
);
expect
(
item
.
text
()).
toContain
(
artifact
.
name
);
expect
(
item
.
attributes
()).
toMatchObject
({
href
:
artifact
.
path
,
download
:
expect
.
any
(
String
),
});
expect
(
item
.
element
.
getAttribute
(
'
href
'
)).
toBe
(
artifact
.
path
);
expect
(
item
.
element
.
getAttribute
(
'
download
'
)).
toBeDefined
();
});
});
});
...
...
@@ -61,4 +60,32 @@ describe('SecurityReportDownloadDropdown component', () => {
expect
(
findDropdown
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
describe
(
'
given title props
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
artifacts
:
[],
loading
:
true
,
title
:
'
test title
'
});
});
it
(
'
should render title
'
,
()
=>
{
expect
(
findDropdown
().
attributes
(
'
title
'
)).
toBe
(
'
test title
'
);
});
it
(
'
should not render text
'
,
()
=>
{
expect
(
findDropdown
().
text
().
trim
()).
toBe
(
''
);
});
});
describe
(
'
given text props
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
artifacts
:
[],
loading
:
true
,
text
:
'
test text
'
});
});
it
(
'
should not render title
'
,
()
=>
{
expect
(
findDropdown
().
props
().
title
).
not
.
toBeDefined
();
});
it
(
'
should render text
'
,
()
=>
{
expect
(
findDropdown
().
props
().
text
).
toContain
(
'
test text
'
);
});
});
});
spec/frontend/vue_shared/security_reports/mock_data.js
View file @
f2212234
...
...
@@ -581,9 +581,18 @@ export const secretDetectionArtifacts = [
},
];
export
const
expectedDownloadDropdownProps
=
{
export
const
expectedDownloadDropdownProps
WithTitle
=
{
loading
:
false
,
artifacts
:
[...
secretDetectionArtifacts
,
...
sastArtifacts
],
text
:
''
,
title
:
'
Download results
'
,
};
export
const
expectedDownloadDropdownPropsWithText
=
{
loading
:
false
,
artifacts
:
[...
secretDetectionArtifacts
,
...
sastArtifacts
],
title
:
''
,
text
:
'
Download results
'
,
};
/**
...
...
spec/frontend/vue_shared/security_reports/security_reports_app_spec.js
View file @
f2212234
...
...
@@ -8,7 +8,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
expectedDownloadDropdownProps
,
expectedDownloadDropdownProps
WithText
,
securityReportMergeRequestDownloadPathsQueryNoArtifactsResponse
,
securityReportMergeRequestDownloadPathsQueryResponse
,
sastDiffSuccessMock
,
...
...
@@ -99,7 +99,7 @@ describe('Security reports app', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithText
);
});
it
(
'
renders the expected message
'
,
()
=>
{
...
...
@@ -203,7 +203,7 @@ describe('Security reports app', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithText
);
});
});
...
...
@@ -225,7 +225,7 @@ describe('Security reports app', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithText
);
});
});
...
...
@@ -247,7 +247,7 @@ describe('Security reports app', () => {
});
it
(
'
renders the download dropdown
'
,
()
=>
{
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
);
expect
(
findDownloadDropdown
().
props
()).
toEqual
(
expectedDownloadDropdownProps
WithText
);
});
});
...
...
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