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

mutation_spec.js « list « store « error_tracking « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6e021185b4d35a53c2ee9bab2ccdf1f02678bafc (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
36
import mutations from '~/error_tracking/store/list/mutations';
import * as types from '~/error_tracking/store/list/mutation_types';

describe('Error tracking mutations', () => {
  describe('SET_ERRORS', () => {
    let state;

    beforeEach(() => {
      state = { errors: [] };
    });

    it('camelizes response', () => {
      const errors = [
        {
          title: 'the title',
          external_url: 'localhost:3456',
          count: 100,
          userCount: 10,
        },
      ];

      mutations[types.SET_ERRORS](state, errors);

      expect(state).toEqual({
        errors: [
          {
            title: 'the title',
            externalUrl: 'localhost:3456',
            count: 100,
            userCount: 10,
          },
        ],
      });
    });
  });
});