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';
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.expandUsagePingEvent);
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>
......
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();
});
});
......
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