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
0a434010
Commit
0a434010
authored
Mar 18, 2021
by
Axel García
Committed by
Mark Florian
Mar 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track trial status popover with Vue mixin
parent
f9b157fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
...ts/contextual_sidebar/components/trial_status_popover.vue
+2
-1
ee/spec/frontend/contextual_sidebar/group_trial_status_popover_spec.js
...end/contextual_sidebar/group_trial_status_popover_spec.js
+18
-2
No files found.
ee/app/assets/javascripts/contextual_sidebar/components/trial_status_popover.vue
View file @
0a434010
...
@@ -19,6 +19,7 @@ export default {
...
@@ -19,6 +19,7 @@ export default {
GlPopover
,
GlPopover
,
GlSprintf
,
GlSprintf
,
},
},
mixins
:
[
Tracking
.
mixin
()],
props
:
{
props
:
{
containerId
:
{
containerId
:
{
type
:
[
String
,
null
],
type
:
[
String
,
null
],
...
@@ -85,7 +86,7 @@ export default {
...
@@ -85,7 +86,7 @@ export default {
this
.
updateDisabledState
();
this
.
updateDisabledState
();
},
},
onShown
()
{
onShown
()
{
Tracking
.
event
(
undefined
,
'
popover_shown
'
,
{
this
.
track
(
'
popover_shown
'
,
{
label
:
'
trial_status_popover
'
,
label
:
'
trial_status_popover
'
,
property
:
'
experiment:show_trial_status_in_sidebar
'
,
property
:
'
experiment:show_trial_status_in_sidebar
'
,
});
});
...
...
ee/spec/frontend/contextual_sidebar/group_trial_status_popover_spec.js
View file @
0a434010
...
@@ -3,9 +3,11 @@ import { GlBreakpointInstance } from '@gitlab/ui/dist/utils';
...
@@ -3,9 +3,11 @@ import { GlBreakpointInstance } from '@gitlab/ui/dist/utils';
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
TrialStatusPopover
from
'
ee/contextual_sidebar/components/trial_status_popover.vue
'
;
import
TrialStatusPopover
from
'
ee/contextual_sidebar/components/trial_status_popover.vue
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
describe
(
'
TrialStatusPopover component
'
,
()
=>
{
describe
(
'
TrialStatusPopover component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
trackingSpy
;
const
getGlButton
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
getGlButton
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
...
@@ -24,6 +26,7 @@ describe('TrialStatusPopover component', () => {
...
@@ -24,6 +26,7 @@ describe('TrialStatusPopover component', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
wrapper
=
createComponent
();
trackingSpy
=
mockTracking
(
'
_category_
'
,
wrapper
.
element
,
jest
.
spyOn
);
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -31,6 +34,8 @@ describe('TrialStatusPopover component', () => {
...
@@ -31,6 +34,8 @@ describe('TrialStatusPopover component', () => {
wrapper
=
null
;
wrapper
=
null
;
});
});
const
getGlPopover
=
()
=>
wrapper
.
findComponent
(
GlPopover
);
it
(
'
matches the snapshot
'
,
()
=>
{
it
(
'
matches the snapshot
'
,
()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
});
...
@@ -51,8 +56,6 @@ describe('TrialStatusPopover component', () => {
...
@@ -51,8 +56,6 @@ describe('TrialStatusPopover component', () => {
describe
(
'
methods
'
,
()
=>
{
describe
(
'
methods
'
,
()
=>
{
describe
(
'
onResize
'
,
()
=>
{
describe
(
'
onResize
'
,
()
=>
{
const
getGlPopover
=
()
=>
wrapper
.
findComponent
(
GlPopover
);
it
.
each
`
it
.
each
`
bp | isDisabled
bp | isDisabled
${
'
xs
'
}
|
${
'
true
'
}
${
'
xs
'
}
|
${
'
true
'
}
...
@@ -72,5 +75,18 @@ describe('TrialStatusPopover component', () => {
...
@@ -72,5 +75,18 @@ describe('TrialStatusPopover component', () => {
},
},
);
);
});
});
describe
(
'
onShown
'
,
()
=>
{
beforeEach
(()
=>
{
getGlPopover
().
vm
.
$emit
(
'
shown
'
);
});
it
(
'
dispatches tracking event
'
,
()
=>
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
popover_shown
'
,
{
label
:
'
trial_status_popover
'
,
property
:
'
experiment:show_trial_status_in_sidebar
'
,
});
});
});
});
});
});
});
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