Commit 5d35ec1d authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Track error status update as separate actions

parent a38eb0c4
......@@ -233,8 +233,8 @@ export default {
Tracking.event(category, action);
},
trackStatusUpdate(status) {
const { category, action, label } = trackErrorStatusUpdateOptions;
Tracking.event(category, action, { label, property: status });
const { category, action } = trackErrorStatusUpdateOptions(status);
Tracking.event(category, action);
},
},
};
......
......@@ -218,8 +218,8 @@ export default {
Tracking.event(category, action);
},
trackStatusUpdate(status) {
const { category, action, label } = trackErrorStatusUpdateOptions;
Tracking.event(category, action, { label, property: status });
const { category, action } = trackErrorStatusUpdateOptions(status);
Tracking.event(category, action);
},
},
};
......
......@@ -30,8 +30,7 @@ export const trackErrorDetailsViewsOptions = {
/**
* Tracks snowplow event when error status is updated
*/
export const trackErrorStatusUpdateOptions = {
export const trackErrorStatusUpdateOptions = status => ({
category: 'Error Tracking',
action: 'update_error_status',
label: 'Status',
};
action: `update_${status}_status`,
});
---
title: Track Sentry error status updates with dedicated actions
merge_request: 33623
author:
type: changed
......@@ -519,11 +519,8 @@ describe('ErrorDetails', () => {
Tracking.event.mockClear();
findUpdateIgnoreStatusButton().vm.$emit('click');
setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions;
expect(Tracking.event).toHaveBeenCalledWith(category, action, {
label,
property: 'ignored',
});
const { category, action } = trackErrorStatusUpdateOptions('ignored');
expect(Tracking.event).toHaveBeenCalledWith(category, action);
});
});
......@@ -531,11 +528,8 @@ describe('ErrorDetails', () => {
Tracking.event.mockClear();
findUpdateResolveStatusButton().vm.$emit('click');
setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions;
expect(Tracking.event).toHaveBeenCalledWith(category, action, {
label,
property: 'resolved',
});
const { category, action } = trackErrorStatusUpdateOptions('resolved');
expect(Tracking.event).toHaveBeenCalledWith(category, action);
});
});
......
......@@ -491,11 +491,8 @@ describe('ErrorTrackingList', () => {
});
setImmediate(() => {
const { category, action, label } = trackErrorStatusUpdateOptions;
expect(Tracking.event).toHaveBeenCalledWith(category, action, {
label,
property: status,
});
const { category, action } = trackErrorStatusUpdateOptions(status);
expect(Tracking.event).toHaveBeenCalledWith(category, action);
});
});
});
......
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