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

utils_spec.js « error_tracking « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e9047cd375e6f1945ca91c6c1118a39bc14759c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as errorTrackingUtils from '~/error_tracking/utils';

const externalUrl = 'https://sentry.io/organizations/test-sentry-nk/issues/1/?project=1';

describe('Error Tracking Events', () => {
  describe('trackViewInSentryOptions', () => {
    it('should return correct event options', () => {
      expect(errorTrackingUtils.trackViewInSentryOptions(externalUrl)).toEqual({
        category: 'Error Tracking',
        action: 'click_view_in_sentry',
        label: 'External Url',
        property: externalUrl,
      });
    });
  });

  describe('trackClickErrorLinkToSentryOptions', () => {
    it('should return correct event options', () => {
      expect(errorTrackingUtils.trackClickErrorLinkToSentryOptions(externalUrl)).toEqual({
        category: 'Error Tracking',
        action: 'click_error_link_to_sentry',
        label: 'Error Link',
        property: externalUrl,
      });
    });
  });
});