2020-04-22 19:07:51 +05:30
|
|
|
import * as getters from '~/ci_variable_list/store/getters';
|
|
|
|
import mockData from '../services/mock_data';
|
|
|
|
|
|
|
|
describe('Ci variable getters', () => {
|
|
|
|
describe('joinedEnvironments', () => {
|
2021-01-03 14:25:43 +05:30
|
|
|
it('should join fetched environments with variable environment scopes', () => {
|
2020-04-22 19:07:51 +05:30
|
|
|
const state = {
|
|
|
|
environments: ['All (default)', 'staging', 'deployment', 'prod'],
|
|
|
|
variables: mockData.mockVariableScopes,
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(getters.joinedEnvironments(state)).toEqual([
|
|
|
|
'All (default)',
|
|
|
|
'deployment',
|
|
|
|
'prod',
|
|
|
|
'production',
|
|
|
|
'staging',
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|