Commit 114ecabe authored by Scott Hampton's avatar Scott Hampton

Remove snowplow event

Remove the snowplow event now that are using
usage ping.
parent a3b40ddf
...@@ -3,7 +3,6 @@ import { GlButton, GlIcon } from '@gitlab/ui'; ...@@ -3,7 +3,6 @@ import { GlButton, GlIcon } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import api from '~/api'; import api from '~/api';
import { sprintf, s__ } from '~/locale'; import { sprintf, s__ } from '~/locale';
import Tracking from '~/tracking';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import GroupedIssuesList from '../components/grouped_issues_list.vue'; import GroupedIssuesList from '../components/grouped_issues_list.vue';
import { componentNames } from '../components/issue_body'; import { componentNames } from '../components/issue_body';
...@@ -29,7 +28,7 @@ export default { ...@@ -29,7 +28,7 @@ export default {
GlButton, GlButton,
GlIcon, GlIcon,
}, },
mixins: [Tracking.mixin(), glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
endpoint: { endpoint: {
type: String, type: String,
...@@ -83,9 +82,8 @@ export default { ...@@ -83,9 +82,8 @@ export default {
methods: { methods: {
...mapActions(['setPaths', 'fetchReports', 'closeModal']), ...mapActions(['setPaths', 'fetchReports', 'closeModal']),
handleToggleEvent() { handleToggleEvent() {
this.track(this.$options.expandEvent);
if (this.glFeatures.usageDataITestingSummaryWidgetTotal) { if (this.glFeatures.usageDataITestingSummaryWidgetTotal) {
api.trackRedisHllUserEvent(this.$options.expandUsagePingEvent); api.trackRedisHllUserEvent(this.$options.expandEvent);
} }
}, },
reportText(report) { reportText(report) {
...@@ -132,8 +130,7 @@ export default { ...@@ -132,8 +130,7 @@ export default {
return report.resolved_failures.concat(report.resolved_errors); return report.resolved_failures.concat(report.resolved_errors);
}, },
}, },
expandEvent: 'expand_test_report_widget', expandEvent: 'i_testing_summary_widget_total',
expandUsagePingEvent: 'i_testing_summary_widget_total',
}; };
</script> </script>
<template> <template>
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mockTracking } from 'helpers/tracking_helper';
import Api from '~/api'; import Api from '~/api';
import GroupedTestReportsApp from '~/reports/grouped_test_report/grouped_test_reports_app.vue'; import GroupedTestReportsApp from '~/reports/grouped_test_report/grouped_test_reports_app.vue';
import { getStoreConfig } from '~/reports/grouped_test_report/store'; import { getStoreConfig } from '~/reports/grouped_test_report/store';
...@@ -111,54 +110,33 @@ describe('Grouped test reports app', () => { ...@@ -111,54 +110,33 @@ describe('Grouped test reports app', () => {
}); });
describe('`Expand` button', () => { describe('`Expand` button', () => {
let trackingSpy; beforeEach(() => {
it('tracks an event on click', () => {
setReports(newFailedTestReports); 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', () => { it('tracks usage ping metric when enabled', () => {
setReports(newFailedTestReports); mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } });
mountComponent(); findExpandButton().trigger('click');
trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn);
expect(trackingSpy).not.toHaveBeenCalled();
const button = findExpandButton();
button.trigger('click');
button.trigger('click');
button.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('only tracks the first expansion', () => {
it('does track usage ping metric', () => { mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } });
setReports(newFailedTestReports); const expandButton = findExpandButton();
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: true } }); expandButton.trigger('click');
findExpandButton().trigger('click'); expandButton.trigger('click');
expandButton.trigger('click');
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1); expect(Api.trackRedisHllUserEvent).toHaveBeenCalledTimes(1);
expect(Api.trackRedisHllUserEvent).toHaveBeenCalledWith(
wrapper.vm.$options.expandUsagePingEvent,
);
});
}); });
describe('with :usage_data_i_testing_summary_widget_total disabled', () => { it('does not track usage ping metric when disabled', () => {
it('does not track usage ping metric', () => { mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: false } });
setReports(newFailedTestReports); findExpandButton().trigger('click');
mountComponent({ glFeatures: { usageDataITestingSummaryWidgetTotal: false } });
findExpandButton().trigger('click');
expect(Api.trackRedisHllUserEvent).not.toHaveBeenCalled(); expect(Api.trackRedisHllUserEvent).not.toHaveBeenCalled();
});
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment