Commit 0dc1b04f authored by Tom Quirk's avatar Tom Quirk

Stub tests for design upload tracking

parent c9388ea2
...@@ -29,6 +29,7 @@ import { ...@@ -29,6 +29,7 @@ import {
import getDesignListQuery from '~/design_management/graphql/queries/get_design_list.query.graphql'; import getDesignListQuery from '~/design_management/graphql/queries/get_design_list.query.graphql';
import permissionsQuery from '~/design_management/graphql/queries/design_permissions.query.graphql'; import permissionsQuery from '~/design_management/graphql/queries/design_permissions.query.graphql';
import moveDesignMutation from '~/design_management/graphql/mutations/move_design.mutation.graphql'; import moveDesignMutation from '~/design_management/graphql/mutations/move_design.mutation.graphql';
import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
const mockPageEl = { const mockPageEl = {
...@@ -482,6 +483,31 @@ describe('Design management index page', () => { ...@@ -482,6 +483,31 @@ describe('Design management index page', () => {
expect(createFlash).toHaveBeenCalledWith(message); expect(createFlash).toHaveBeenCalledWith(message);
}); });
}); });
describe('tracking', () => {
let trackingSpy;
beforeEach(() => {
trackingSpy = mockTracking('_category_', undefined, jest.spyOn);
});
afterEach(() => {
unmockTracking();
});
it('tracks design creation', () => {
createComponent({ stubs: { GlEmptyState } });
wrapper.vm.onUploadDesign([{ name: 'test' }]);
wrapper.vm.onUploadDesignDone();
// expect(trackingSpy).toHaveBeenCalledWith(undefined, 'create_design', {});
});
it('tracks design modification', () => {
wrapper.vm.onUploadDesignDone();
// expect(trackingSpy).toHaveBeenCalledWith(undefined, 'update_design', {});
});
});
}); });
describe('on latest version when has designs', () => { describe('on latest version when has designs', () => {
......
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