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
19ecbed8
Commit
19ecbed8
authored
Mar 30, 2022
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename HelpPopover when imported by report_section
parent
775bdf58
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
app/assets/javascripts/reports/components/report_section.vue
app/assets/javascripts/reports/components/report_section.vue
+3
-3
spec/frontend/reports/components/report_section_spec.js
spec/frontend/reports/components/report_section_spec.js
+31
-0
No files found.
app/assets/javascripts/reports/components/report_section.vue
View file @
19ecbed8
...
@@ -3,7 +3,7 @@ import { GlButton } from '@gitlab/ui';
...
@@ -3,7 +3,7 @@ import { GlButton } from '@gitlab/ui';
import
api
from
'
~/api
'
;
import
api
from
'
~/api
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
StatusIcon
from
'
~/vue_merge_request_widget/components/mr_widget_status_icon.vue
'
;
import
StatusIcon
from
'
~/vue_merge_request_widget/components/mr_widget_status_icon.vue
'
;
import
Popover
from
'
~/vue_shared/components/help_popover.vue
'
;
import
Help
Popover
from
'
~/vue_shared/components/help_popover.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
status
,
SLOT_SUCCESS
,
SLOT_LOADING
,
SLOT_ERROR
}
from
'
../constants
'
;
import
{
status
,
SLOT_SUCCESS
,
SLOT_LOADING
,
SLOT_ERROR
}
from
'
../constants
'
;
import
IssuesList
from
'
./issues_list.vue
'
;
import
IssuesList
from
'
./issues_list.vue
'
;
...
@@ -13,7 +13,7 @@ export default {
...
@@ -13,7 +13,7 @@ export default {
components
:
{
components
:
{
GlButton
,
GlButton
,
IssuesList
,
IssuesList
,
Popover
,
Help
Popover
,
StatusIcon
,
StatusIcon
,
},
},
mixins
:
[
glFeatureFlagsMixin
()],
mixins
:
[
glFeatureFlagsMixin
()],
...
@@ -193,7 +193,7 @@ export default {
...
@@ -193,7 +193,7 @@ export default {
<div
class=
"gl-display-flex gl-align-items-center"
>
<div
class=
"gl-display-flex gl-align-items-center"
>
<p
class=
"gl-line-height-normal gl-m-0"
>
{{
headerText
}}
</p>
<p
class=
"gl-line-height-normal gl-m-0"
>
{{
headerText
}}
</p>
<slot
:name=
"slotName"
></slot>
<slot
:name=
"slotName"
></slot>
<popover
<
help-
popover
v-if=
"hasPopover"
v-if=
"hasPopover"
:options=
"popoverOptions"
:options=
"popoverOptions"
class=
"gl-ml-2 gl-display-inline-flex"
class=
"gl-ml-2 gl-display-inline-flex"
...
...
spec/frontend/reports/components/report_section_spec.js
View file @
19ecbed8
...
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
...
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
mountComponent
,
{
mountComponentWithSlots
}
from
'
helpers/vue_mount_component_helper
'
;
import
mountComponent
,
{
mountComponentWithSlots
}
from
'
helpers/vue_mount_component_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
HelpPopover
from
'
~/vue_shared/components/help_popover.vue
'
;
import
reportSection
from
'
~/reports/components/report_section.vue
'
;
import
reportSection
from
'
~/reports/components/report_section.vue
'
;
describe
(
'
Report section
'
,
()
=>
{
describe
(
'
Report section
'
,
()
=>
{
...
@@ -9,6 +10,7 @@ describe('Report section', () => {
...
@@ -9,6 +10,7 @@ describe('Report section', () => {
let
wrapper
;
let
wrapper
;
const
ReportSection
=
Vue
.
extend
(
reportSection
);
const
ReportSection
=
Vue
.
extend
(
reportSection
);
const
findCollapseButton
=
()
=>
wrapper
.
findByTestId
(
'
report-section-expand-button
'
);
const
findCollapseButton
=
()
=>
wrapper
.
findByTestId
(
'
report-section-expand-button
'
);
const
findPopover
=
()
=>
wrapper
.
findComponent
(
HelpPopover
);
const
resolvedIssues
=
[
const
resolvedIssues
=
[
{
{
...
@@ -269,4 +271,33 @@ describe('Report section', () => {
...
@@ -269,4 +271,33 @@ describe('Report section', () => {
expect
(
vm
.
$el
.
textContent
.
trim
()).
not
.
toContain
(
'
This is a success
'
);
expect
(
vm
.
$el
.
textContent
.
trim
()).
not
.
toContain
(
'
This is a success
'
);
});
});
});
});
describe
(
'
help popover
'
,
()
=>
{
describe
(
'
when popover options are defined
'
,
()
=>
{
const
options
=
{
title
:
'
foo
'
,
content
:
'
bar
'
,
};
beforeEach
(()
=>
{
createComponent
({
popoverOptions
:
options
,
});
});
it
(
'
popover is shown with options
'
,
()
=>
{
expect
(
findPopover
().
props
(
'
options
'
)).
toEqual
(
options
);
});
});
describe
(
'
when popover options are not defined
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
popoverOptions
:
{}
});
});
it
(
'
popover is not shown
'
,
()
=>
{
expect
(
findPopover
().
exists
()).
toBe
(
false
);
});
});
});
});
});
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