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