Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-16 12:09:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-16 12:09:06 +0300
commited7568cc8083a9f8923d1a26bc0d8f60e3f629a3 (patch)
tree147bef3e0dd36eb5ccf915799d527b73f4b696f0 /spec/frontend/incidents
parente94d662e5aabd4918de373b37c4f084325c7c1f8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/incidents')
-rw-r--r--spec/frontend/incidents/components/incidents_list_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/frontend/incidents/components/incidents_list_spec.js b/spec/frontend/incidents/components/incidents_list_spec.js
index 99365a037a4..709f66bb352 100644
--- a/spec/frontend/incidents/components/incidents_list_spec.js
+++ b/spec/frontend/incidents/components/incidents_list_spec.js
@@ -10,6 +10,8 @@ import {
TH_CREATED_AT_TEST_ID,
TH_SEVERITY_TEST_ID,
TH_PUBLISHED_TEST_ID,
+ trackIncidentCreateNewOptions,
+ trackIncidentListViewsOptions,
} from '~/incidents/constants';
import mockIncidents from '../mocks/incidents.json';
@@ -291,4 +293,25 @@ describe('Incidents List', () => {
expect(columnHeader().attributes('aria-sort')).toBe(nextSort);
});
});
+
+ describe('Snowplow tracking', () => {
+ beforeEach(() => {
+ mountComponent({
+ data: { incidents: { list: mockIncidents }, incidentsCount: {} },
+ loading: false,
+ });
+ });
+
+ it('should track incident list views', () => {
+ const { category, action } = trackIncidentListViewsOptions;
+ expect(Tracking.event).toHaveBeenCalledWith(category, action);
+ });
+
+ it('should track incident creation events', async () => {
+ findCreateIncidentBtn().vm.$emit('click');
+ await wrapper.vm.$nextTick();
+ const { category, action } = trackIncidentCreateNewOptions;
+ expect(Tracking.event).toHaveBeenCalledWith(category, action);
+ });
+ });
});