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

mutations_spec.js « store « grafana_integration « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 18e8739418932848836ad23e49c737048ad0c633 (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
28
29
30
31
32
33
34
35
import mutations from '~/grafana_integration/store/mutations';
import createState from '~/grafana_integration/store/state';

describe('grafana integration mutations', () => {
  let localState;

  beforeEach(() => {
    localState = createState();
  });

  describe('SET_GRAFANA_URL', () => {
    it('sets grafanaUrl', () => {
      const mockUrl = 'mockUrl';
      mutations.SET_GRAFANA_URL(localState, mockUrl);

      expect(localState.grafanaUrl).toBe(mockUrl);
    });
  });

  describe('SET_GRAFANA_TOKEN', () => {
    it('sets grafanaToken', () => {
      const mockToken = 'mockToken';
      mutations.SET_GRAFANA_TOKEN(localState, mockToken);

      expect(localState.grafanaToken).toBe(mockToken);
    });
  });
  describe('SET_GRAFANA_ENABLED', () => {
    it('updates grafanaEnabled for integration', () => {
      mutations.SET_GRAFANA_ENABLED(localState, true);

      expect(localState.grafanaEnabled).toBe(true);
    });
  });
});