summaryrefslogtreecommitdiff
path: root/spec/frontend/ci_variable_list/store/getters_spec.js
blob: 92f22b187639ad300bf7d03e0a897d6521b1efe7 (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 '~/ci_variable_list/store/getters';
import mockData from '../services/mock_data';

describe('Ci variable getters', () => {
  describe('joinedEnvironments', () => {
    it('should join fetched environments with variable environment scopes', () => {
      const state = {
        environments: ['All (default)', 'staging', 'deployment', 'prod'],
        variables: mockData.mockVariableScopes,
      };

      expect(getters.joinedEnvironments(state)).toEqual([
        'All (default)',
        'deployment',
        'prod',
        'production',
        'staging',
      ]);
    });
  });
});