Commit 4d9648d1 authored by Angelo Gulina's avatar Angelo Gulina

Track Zuora events with actual error

parent 27c053e3
......@@ -87,9 +87,9 @@ export default {
// no need to reload the iframe and emit the failure event
// Add a 15px height to the iframe to accomodate the error message
this.iframeHeight += ZUORA_CLIENT_ERROR_HEIGHT;
this.track('client_error');
this.track('client_error', { property: event.data.msg });
} else if (parseInt(event.data.code, 10) > 6) {
this.track('error');
this.track('error', { property: event.data.msg });
this.error = event.data.msg;
window.removeEventListener('message', this.handleFrameMessages, true);
this.$refs.zuora.src = this.iframeSrc;
......
......@@ -147,10 +147,12 @@ describe('Zuora', () => {
});
describe('when failure and code less than 7', () => {
const msg = 'a propagated error';
beforeEach(() => {
wrapper.vm.handleFrameMessages({
origin: 'https://gitlab.com',
data: { success: false, code: 6 },
data: { success: false, code: 6, msg },
});
});
......@@ -166,6 +168,7 @@ describe('Zuora', () => {
it('tracks client side Zuora error', () => {
expect(trackingSpy).toHaveBeenCalledWith('Zuora_cc', 'client_error', {
property: msg,
category: 'Zuora_cc',
});
});
......@@ -198,7 +201,10 @@ describe('Zuora', () => {
});
it('tracks Zuora error', () => {
expect(trackingSpy).toHaveBeenCalledWith('Zuora_cc', 'error', { category: 'Zuora_cc' });
expect(trackingSpy).toHaveBeenCalledWith('Zuora_cc', 'error', {
property: 'error',
category: 'Zuora_cc',
});
});
});
});
......
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