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
dbe8e684
Commit
dbe8e684
authored
Jan 04, 2022
by
Jannik Lehmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tracking counter to mr_license_compliance_widget
parent
0b903b24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
ee/app/assets/javascripts/vue_shared/license_compliance/mr_widget_license_report.vue
...ue_shared/license_compliance/mr_widget_license_report.vue
+2
-1
ee/spec/frontend/vue_shared/license_compliance/mr_widget_license_report_spec.js
...hared/license_compliance/mr_widget_license_report_spec.js
+18
-6
No files found.
ee/app/assets/javascripts/vue_shared/license_compliance/mr_widget_license_report.vue
View file @
dbe8e684
<
script
>
import
{
GlLink
,
GlIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
GlLink
,
GlIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
api
from
'
~/api
'
;
import
{
componentNames
,
iconComponentNames
}
from
'
ee/reports/components/issue_body
'
;
import
{
LICENSE_MANAGEMENT
}
from
'
ee/vue_shared/license_compliance/store/constants
'
;
...
...
@@ -114,6 +114,7 @@ export default {
methods
:
{
trackVisitedPath
(
trackAction
)
{
api
.
trackRedisHllUserEvent
(
trackAction
);
api
.
trackRedisCounterEvent
(
trackAction
);
},
...
mapActions
(
LICENSE_MANAGEMENT
,
[
'
setAPISettings
'
,
...
...
ee/spec/frontend/vue_shared/license_compliance/mr_widget_license_report_spec.js
View file @
dbe8e684
...
...
@@ -118,22 +118,30 @@ describe('License Report MR Widget', () => {
});
describe
(
'
snowplow
'
,
()
=>
{
let
trackEventSpy
;
let
trackUserEventSpy
;
let
trackCounterEventSpy
;
beforeEach
(()
=>
{
mountComponent
();
trackEventSpy
=
jest
.
spyOn
(
api
,
'
trackRedisHllUserEvent
'
).
mockImplementation
(()
=>
{});
trackUserEventSpy
=
jest
.
spyOn
(
api
,
'
trackRedisHllUserEvent
'
).
mockImplementation
(()
=>
{});
trackCounterEventSpy
=
jest
.
spyOn
(
api
,
'
trackRedisCounterEvent
'
)
.
mockImplementation
(()
=>
{});
});
afterEach
(()
=>
{
trackEventSpy
.
mockRestore
();
trackUserEventSpy
.
mockRestore
();
trackCounterEventSpy
.
mockRestore
();
});
it
(
'
tracks users_visiting_testing_license_compliance_full_report
'
,
()
=>
{
wrapper
.
find
(
'
[data-testid="full-report-button"]
'
).
vm
.
$emit
(
'
click
'
);
expect
(
trackEventSpy
).
toHaveBeenCalledWith
(
expect
(
trackUserEventSpy
).
toHaveBeenCalledWith
(
'
users_visiting_testing_license_compliance_full_report
'
,
);
expect
(
trackCounterEventSpy
).
toHaveBeenCalledWith
(
'
users_visiting_testing_license_compliance_full_report
'
,
);
});
...
...
@@ -141,7 +149,11 @@ describe('License Report MR Widget', () => {
it
(
'
tracks users_visiting_testing_manage_license_compliance
'
,
()
=>
{
wrapper
.
find
(
'
[data-testid="manage-licenses-button"]
'
).
vm
.
$emit
(
'
click
'
);
expect
(
trackEventSpy
).
toHaveBeenCalledWith
(
expect
(
trackUserEventSpy
).
toHaveBeenCalledWith
(
'
users_visiting_testing_manage_license_compliance
'
,
);
expect
(
trackCounterEventSpy
).
toHaveBeenCalledWith
(
'
users_visiting_testing_manage_license_compliance
'
,
);
});
...
...
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