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
37e08863
Commit
37e08863
authored
Mar 25, 2021
by
Sam Beckham
Committed by
Savas Vedova
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds changes from @svedova review
- Uses the `findByTestId` helper to target the expand button
parent
35bd91b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
app/assets/javascripts/reports/components/report_section.vue
app/assets/javascripts/reports/components/report_section.vue
+6
-5
changelogs/unreleased/expand-button-fix.yml
changelogs/unreleased/expand-button-fix.yml
+5
-0
spec/frontend/reports/components/report_section_spec.js
spec/frontend/reports/components/report_section_spec.js
+13
-9
No files found.
app/assets/javascripts/reports/components/report_section.vue
View file @
37e08863
<
script
>
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
StatusIcon
from
'
~/vue_merge_request_widget/components/mr_widget_status_icon.vue
'
;
import
Popover
from
'
~/vue_shared/components/help_popover.vue
'
;
...
...
@@ -8,9 +9,10 @@ import IssuesList from './issues_list.vue';
export
default
{
name
:
'
ReportSection
'
,
components
:
{
GlButton
,
IssuesList
,
StatusIcon
,
Popover
,
StatusIcon
,
},
props
:
{
alwaysOpen
:
{
...
...
@@ -186,16 +188,15 @@ export default {
<slot
name=
"action-buttons"
:is-collapsible=
"isCollapsible"
></slot>
<button
<
gl-
button
v-if=
"isCollapsible"
type=
"butto
n"
class=
"js-collapse-bt
n"
data-testid=
"report-section-expand-button"
class=
"js-collapse-btn btn float-right btn-sm align-self-center"
data-qa-selector=
"expand_report_button"
@
click=
"toggleCollapsed"
>
{{
collapseText
}}
</button>
</
gl-
button>
</div>
</div>
...
...
changelogs/unreleased/expand-button-fix.yml
0 → 100644
View file @
37e08863
---
title
:
Migrates the expand button in MR reports to GitLab UI
merge_request
:
57021
author
:
type
:
other
spec/frontend/reports/components/report_section_spec.js
View file @
37e08863
import
{
shallowM
ount
}
from
'
@vue/test-utils
'
;
import
{
m
ount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
mountComponent
,
{
mountComponentWithSlots
}
from
'
helpers/vue_mount_component_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
reportSection
from
'
~/reports/components/report_section.vue
'
;
describe
(
'
Report section
'
,
()
=>
{
let
vm
;
let
wrapper
;
const
ReportSection
=
Vue
.
extend
(
reportSection
);
const
findCollapseButton
=
()
=>
wrapper
.
findByTestId
(
'
report-section-expand-button
'
);
const
resolvedIssues
=
[
{
...
...
@@ -30,12 +32,14 @@ describe('Report section', () => {
};
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
reportSection
,
{
propsData
:
{
...
defaultProps
,
...
props
,
},
});
wrapper
=
extendedWrapper
(
mount
(
reportSection
,
{
propsData
:
{
...
defaultProps
,
...
props
,
},
}),
);
return
wrapper
;
};
...
...
@@ -182,7 +186,7 @@ describe('Report section', () => {
expect
(
wrapper
.
emitted
().
toggleEvent
).
toBeUndefined
();
wrapper
.
vm
.
$el
.
querySelector
(
'
button
'
).
click
(
);
findCollapseButton
().
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
...
...
@@ -197,7 +201,7 @@ describe('Report section', () => {
expect
(
wrapper
.
emitted
().
toggleEvent
).
toBeUndefined
();
wrapper
.
vm
.
$el
.
querySelector
(
'
button
'
).
click
(
);
findCollapseButton
().
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
...
...
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