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

getters_spec.js « store « commit « projects « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bd0cb3568546792605bac1c8f3eeca96d0878323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as getters from '~/projects/commit/store/getters';
import mockData from '../mock_data';

describe('Commit form modal getters', () => {
  describe('joinedBranches', () => {
    it('should join fetched branches with variable branches', () => {
      const state = {
        branches: mockData.mockBranches,
      };

      expect(getters.joinedBranches(state)).toEqual(mockData.mockBranches.sort());
    });

    it('should provide a uniq list of branches', () => {
      const branches = ['_branch_', '_branch_', '_different_branch'];
      const state = { branches };

      expect(getters.joinedBranches(state)).toEqual(branches.slice(1));
    });
  });
});