summaryrefslogtreecommitdiff
path: root/spec/frontend/issue_show/components/incidents/incident_tabs_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issue_show/components/incidents/incident_tabs_spec.js')
-rw-r--r--spec/frontend/issue_show/components/incidents/incident_tabs_spec.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/frontend/issue_show/components/incidents/incident_tabs_spec.js b/spec/frontend/issue_show/components/incidents/incident_tabs_spec.js
index a51b497cd79..c6200fd69bf 100644
--- a/spec/frontend/issue_show/components/incidents/incident_tabs_spec.js
+++ b/spec/frontend/issue_show/components/incidents/incident_tabs_spec.js
@@ -6,6 +6,8 @@ import { descriptionProps } from '../../mock_data';
import DescriptionComponent from '~/issue_show/components/description.vue';
import HighlightBar from '~/issue_show/components/incidents/highlight_bar.vue';
import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue';
+import Tracking from '~/tracking';
+import { trackIncidentDetailsViewsOptions } from '~/incidents/constants';
const mockAlert = {
__typename: 'AlertManagementAlert',
@@ -57,7 +59,6 @@ describe('Incident Tabs component', () => {
it('does not show the alert details tab', () => {
expect(findAlertDetailsComponent().exists()).toBe(false);
- expect(findHighlightBarComponent().exists()).toBe(false);
});
});
@@ -79,7 +80,7 @@ describe('Incident Tabs component', () => {
it('renders the alert details table with the correct props', () => {
const alert = { iid: mockAlert.iid };
- expect(findAlertDetailsComponent().props('alert')).toEqual(alert);
+ expect(findAlertDetailsComponent().props('alert')).toMatchObject(alert);
expect(findAlertDetailsComponent().props('loading')).toBe(true);
});
@@ -98,4 +99,16 @@ describe('Incident Tabs component', () => {
expect(findDescriptionComponent().props()).toMatchObject(descriptionProps);
});
});
+
+ describe('Snowplow tracking', () => {
+ beforeEach(() => {
+ jest.spyOn(Tracking, 'event');
+ mountComponent();
+ });
+
+ it('should track incident details views', () => {
+ const { category, action } = trackIncidentDetailsViewsOptions;
+ expect(Tracking.event).toHaveBeenCalledWith(category, action);
+ });
+ });
});