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
114ecabe
Commit
114ecabe
authored
Apr 06, 2021
by
Scott Hampton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove snowplow event
Remove the snowplow event now that are using usage ping.
parent
a3b40ddf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
45 deletions
+20
-45
app/assets/javascripts/reports/grouped_test_report/grouped_test_reports_app.vue
.../reports/grouped_test_report/grouped_test_reports_app.vue
+3
-6
spec/frontend/reports/grouped_test_report/grouped_test_reports_app_spec.js
...orts/grouped_test_report/grouped_test_reports_app_spec.js
+17
-39
No files found.
app/assets/javascripts/reports/grouped_test_report/grouped_test_reports_app.vue
View file @
114ecabe
...
...
@@ -3,7 +3,6 @@ import { GlButton, GlIcon } from '@gitlab/ui';
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
api
from
'
~/api
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
import
Tracking
from
'
~/tracking
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
GroupedIssuesList
from
'
../components/grouped_issues_list.vue
'
;
import
{
componentNames
}
from
'
../components/issue_body
'
;
...
...
@@ -29,7 +28,7 @@ export default {
GlButton
,
GlIcon
,
},
mixins
:
[
Tracking
.
mixin
(),
glFeatureFlagsMixin
()],
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
endpoint
:
{
type
:
String
,
...
...
@@ -83,9 +82,8 @@ export default {
methods
:
{
...
mapActions
([
'
setPaths
'
,
'
fetchReports
'
,
'
closeModal
'
]),
handleToggleEvent
()
{
this
.
track
(
this
.
$options
.
expandEvent
);
if
(
this
.
glFeatures
.
usageDataITestingSummaryWidgetTotal
)
{
api
.
trackRedisHllUserEvent
(
this
.
$options
.
expand
UsagePing
Event
);
api
.
trackRedisHllUserEvent
(
this
.
$options
.
expandEvent
);
}
},
reportText
(
report
)
{
...
...
@@ -132,8 +130,7 @@ export default {
return
report
.
resolved_failures
.
concat
(
report
.
resolved_errors
);
},
},
expandEvent
:
'
expand_test_report_widget
'
,
expandUsagePingEvent
:
'
i_testing_summary_widget_total
'
,
expandEvent
:
'
i_testing_summary_widget_total
'
,
};
</
script
>
<
template
>
...
...
spec/frontend/reports/grouped_test_report/grouped_test_reports_app_spec.js
View file @
114ecabe
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
Api
from
'
~/api
'
;
import
GroupedTestReportsApp
from
'
~/reports/grouped_test_report/grouped_test_reports_app.vue
'
;
import
{
getStoreConfig
}
from
'
~/reports/grouped_test_report/store
'
;
...
...
@@ -111,54 +110,33 @@ describe('Grouped test reports app', () => {
});
describe
(
'
`Expand` button
'
,
()
=>
{
let
trackingSpy
;
it
(
'
tracks an event on click
'
,
()
=>
{
beforeEach
(()
=>
{
setReports
(
newFailedTestReports
);
mountComponent
();
trackingSpy
=
mockTracking
(
'
_category_
'
,
wrapper
.
element
,
jest
.
spyOn
);
findExpandButton
().
trigger
(
'
click
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
expand_test_report_widget
'
,
{});
});
it
(
'
only tracks the first expansion
'
,
()
=>
{
setReports
(
newFailedTestReports
);
mountComponent
();
trackingSpy
=
mockTracking
(
'
_category_
'
,
wrapper
.
element
,
jest
.
spyOn
);
expect
(
trackingSpy
).
not
.
toHaveBeenCalled
();
const
button
=
findExpandButton
();
button
.
trigger
(
'
click
'
);
button
.
trigger
(
'
click
'
);
button
.
trigger
(
'
click
'
);
it
(
'
tracks usage ping metric when enabled
'
,
()
=>
{
mountComponent
({
glFeatures
:
{
usageDataITestingSummaryWidgetTotal
:
true
}
});
findExpandButton
().
trigger
(
'
click
'
);
expect
(
trackingSpy
).
toHaveBeenCalledTimes
(
1
);
expect
(
Api
.
trackRedisHllUserEvent
).
toHaveBeenCalledTimes
(
1
);
expect
(
Api
.
trackRedisHllUserEvent
).
toHaveBeenCalledWith
(
wrapper
.
vm
.
$options
.
expandEvent
);
});
describe
(
'
with :usage_data_i_testing_summary_widget_total enabled
'
,
()
=>
{
it
(
'
does track usage ping metric
'
,
()
=>
{
setReports
(
newFailedTestReports
);
mountComponent
({
glFeatures
:
{
usageDataITestingSummaryWidgetTotal
:
true
}
});
findExpandButton
().
trigger
(
'
click
'
);
it
(
'
only tracks the first expansion
'
,
()
=>
{
mountComponent
({
glFeatures
:
{
usageDataITestingSummaryWidgetTotal
:
true
}
});
const
expandButton
=
findExpandButton
();
expandButton
.
trigger
(
'
click
'
);
expandButton
.
trigger
(
'
click
'
);
expandButton
.
trigger
(
'
click
'
);
expect
(
Api
.
trackRedisHllUserEvent
).
toHaveBeenCalledTimes
(
1
);
expect
(
Api
.
trackRedisHllUserEvent
).
toHaveBeenCalledWith
(
wrapper
.
vm
.
$options
.
expandUsagePingEvent
,
);
});
expect
(
Api
.
trackRedisHllUserEvent
).
toHaveBeenCalledTimes
(
1
);
});
describe
(
'
with :usage_data_i_testing_summary_widget_total disabled
'
,
()
=>
{
it
(
'
does not track usage ping metric
'
,
()
=>
{
setReports
(
newFailedTestReports
);
mountComponent
({
glFeatures
:
{
usageDataITestingSummaryWidgetTotal
:
false
}
});
findExpandButton
().
trigger
(
'
click
'
);
it
(
'
does not track usage ping metric when disabled
'
,
()
=>
{
mountComponent
({
glFeatures
:
{
usageDataITestingSummaryWidgetTotal
:
false
}
});
findExpandButton
().
trigger
(
'
click
'
);
expect
(
Api
.
trackRedisHllUserEvent
).
not
.
toHaveBeenCalled
();
});
expect
(
Api
.
trackRedisHllUserEvent
).
not
.
toHaveBeenCalled
();
});
});
...
...
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