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
108e99cc
Commit
108e99cc
authored
Oct 19, 2020
by
Marvin Karegyeya
Committed by
Nathan Friend
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace GlDeprecatedDropdown with GlDropdown in code_coverage.vue
parent
f090988f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
88 deletions
+60
-88
app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue
...cripts/pages/projects/graphs/components/code_coverage.vue
+10
-24
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-pa.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-pa.yml
+5
-0
spec/frontend/pages/projects/graphs/__snapshots__/code_coverage_spec.js.snap
.../projects/graphs/__snapshots__/code_coverage_spec.js.snap
+40
-51
spec/frontend/pages/projects/graphs/code_coverage_spec.js
spec/frontend/pages/projects/graphs/code_coverage_spec.js
+5
-13
No files found.
app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue
View file @
108e99cc
<
script
>
<
script
>
import
{
import
{
GlAlert
,
GlDropdown
,
GlDropdownItem
,
GlSprintf
}
from
'
@gitlab/ui
'
;
GlAlert
,
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
,
GlSprintf
,
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlAreaChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
get
}
from
'
lodash
'
;
import
{
get
}
from
'
lodash
'
;
...
@@ -17,9 +11,8 @@ export default {
...
@@ -17,9 +11,8 @@ export default {
components
:
{
components
:
{
GlAlert
,
GlAlert
,
GlAreaChart
,
GlAreaChart
,
GlDeprecatedDropdown
,
GlDropdown
,
GlDeprecatedDropdownItem
,
GlDropdownItem
,
GlIcon
,
GlSprintf
,
GlSprintf
,
},
},
props
:
{
props
:
{
...
@@ -140,25 +133,18 @@ export default {
...
@@ -140,25 +133,18 @@ export default {
{{
__
(
'
It seems that there is currently no available data for code coverage
'
)
}}
{{
__
(
'
It seems that there is currently no available data for code coverage
'
)
}}
</span>
</span>
</gl-alert>
</gl-alert>
<gl-d
eprecated-d
ropdown
v-if=
"canShowData"
:text=
"selectedDailyCoverageName"
>
<gl-dropdown
v-if=
"canShowData"
:text=
"selectedDailyCoverageName"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"(
{ group_name }, index) in dailyCoverageData"
v-for=
"(
{ group_name }, index) in dailyCoverageData"
:key="index"
:key="index"
:value="group_name"
:value="group_name"
:is-check-item="true"
:is-checked="index === selectedCoverageIndex"
@click="setSelectedCoverage(index)"
@click="setSelectedCoverage(index)"
>
>
<div
class=
"gl-display-flex"
>
<gl-icon
v-if=
"index === selectedCoverageIndex"
name=
"mobile-issue-close"
class=
"gl-absolute"
/>
<span
class=
"gl-display-flex align-items-center ml-4"
>
{{
group_name
}}
{{
group_name
}}
</span>
</gl-dropdown-item>
</div>
</gl-dropdown>
</gl-deprecated-dropdown-item>
</gl-deprecated-dropdown>
</div>
</div>
<gl-area-chart
<gl-area-chart
v-if=
"!isLoading"
v-if=
"!isLoading"
...
...
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-pa.yml
0 → 100644
View file @
108e99cc
---
title
:
Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/pages/projects/graphs/components/code_coverage.vue
merge_request
:
41423
author
:
nuwe1
type
:
other
spec/frontend/pages/projects/graphs/__snapshots__/code_coverage_spec.js.snap
View file @
108e99cc
...
@@ -9,65 +9,54 @@ exports[`Code Coverage when fetching data is successful matches the snapshot 1`]
...
@@ -9,65 +9,54 @@ exports[`Code Coverage when fetching data is successful matches the snapshot 1`]
<!---->
<!---->
<gl-deprecated-dropdown-stub
<gl-dropdown-stub
category="tertiary"
headertext=""
size="medium"
text="rspec"
text="rspec"
variant="default"
>
>
<gl-deprecated-dropdown-item-stub
<gl-dropdown-item-stub
avatarurl=""
iconcolor=""
iconname=""
iconrightname=""
ischecked="true"
ischeckitem="true"
secondarytext=""
value="rspec"
value="rspec"
>
>
<div
class="gl-display-flex"
>
<gl-icon-stub
class="gl-absolute"
name="mobile-issue-close"
size="16"
/>
<span
class="gl-display-flex align-items-center ml-4"
>
rspec
rspec
</span>
</gl-dropdown-item-stub>
</div>
<gl-dropdown-item-stub
</gl-deprecated-dropdown-item-stub>
avatarurl=""
<gl-deprecated-dropdown-item-stub
iconcolor=""
iconname=""
iconrightname=""
ischeckitem="true"
secondarytext=""
value="cypress"
value="cypress"
>
>
<div
class="gl-display-flex"
>
<!---->
<span
class="gl-display-flex align-items-center ml-4"
>
cypress
cypress
</span>
</gl-dropdown-item-stub>
</div>
<gl-dropdown-item-stub
</gl-deprecated-dropdown-item-stub>
avatarurl=""
<gl-deprecated-dropdown-item-stub
iconcolor=""
iconname=""
iconrightname=""
ischeckitem="true"
secondarytext=""
value="karma"
value="karma"
>
>
<div
class="gl-display-flex"
>
<!---->
<span
class="gl-display-flex align-items-center ml-4"
>
karma
karma
</span>
</gl-dropdown-item-stub>
</div>
</gl-dropdown-stub>
</gl-deprecated-dropdown-item-stub>
</gl-deprecated-dropdown-stub>
</div>
</div>
<gl-area-chart-stub
<gl-area-chart-stub
...
...
spec/frontend/pages/projects/graphs/code_coverage_spec.js
View file @
108e99cc
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlAlert
,
Gl
Icon
,
GlDeprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
Gl
Dropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlAreaChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -17,7 +17,7 @@ describe('Code Coverage', () => {
...
@@ -17,7 +17,7 @@ describe('Code Coverage', () => {
const
findAlert
=
()
=>
wrapper
.
find
(
GlAlert
);
const
findAlert
=
()
=>
wrapper
.
find
(
GlAlert
);
const
findAreaChart
=
()
=>
wrapper
.
find
(
GlAreaChart
);
const
findAreaChart
=
()
=>
wrapper
.
find
(
GlAreaChart
);
const
findAllDropdownItems
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findAllDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstDropdownItem
=
()
=>
findAllDropdownItems
().
at
(
0
);
const
findFirstDropdownItem
=
()
=>
findAllDropdownItems
().
at
(
0
);
const
findSecondDropdownItem
=
()
=>
findAllDropdownItems
().
at
(
1
);
const
findSecondDropdownItem
=
()
=>
findAllDropdownItems
().
at
(
1
);
...
@@ -124,7 +124,7 @@ describe('Code Coverage', () => {
...
@@ -124,7 +124,7 @@ describe('Code Coverage', () => {
});
});
it
(
'
renders the dropdown with all custom names as options
'
,
()
=>
{
it
(
'
renders the dropdown with all custom names as options
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
).
exists
()).
toBeDefined
();
expect
(
wrapper
.
find
(
GlDropdown
).
exists
()).
toBeDefined
();
expect
(
findAllDropdownItems
()).
toHaveLength
(
codeCoverageMockData
.
length
);
expect
(
findAllDropdownItems
()).
toHaveLength
(
codeCoverageMockData
.
length
);
expect
(
findFirstDropdownItem
().
text
()).
toBe
(
codeCoverageMockData
[
0
].
group_name
);
expect
(
findFirstDropdownItem
().
text
()).
toBe
(
codeCoverageMockData
[
0
].
group_name
);
});
});
...
@@ -145,16 +145,8 @@ describe('Code Coverage', () => {
...
@@ -145,16 +145,8 @@ describe('Code Coverage', () => {
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
expect
(
findFirstDropdownItem
().
attributes
(
'
ischecked
'
)).
toBeFalsy
();
findFirstDropdownItem
()
expect
(
findSecondDropdownItem
().
attributes
(
'
ischecked
'
)).
toBeTruthy
();
.
find
(
GlIcon
)
.
exists
(),
).
toBe
(
false
);
expect
(
findSecondDropdownItem
()
.
find
(
GlIcon
)
.
exists
(),
).
toBe
(
true
);
});
});
it
(
'
updates the graph data when selecting a different option in dropdown
'
,
async
()
=>
{
it
(
'
updates the graph data when selecting a different option in dropdown
'
,
async
()
=>
{
...
...
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