2021-02-14 13:09:20 -05:00
|
|
|
import * as types from '~/integrations/edit/store/mutation_types';
|
2020-07-16 23:09:14 -04:00
|
|
|
import mutations from '~/integrations/edit/store/mutations';
|
|
|
|
import createState from '~/integrations/edit/store/state';
|
|
|
|
|
|
|
|
describe('Integration form store mutations', () => {
|
|
|
|
let state;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
state = createState();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe(`${types.SET_OVERRIDE}`, () => {
|
|
|
|
it('sets override', () => {
|
|
|
|
mutations[types.SET_OVERRIDE](state, true);
|
|
|
|
|
|
|
|
expect(state.override).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
2020-11-16 10:09:23 -05:00
|
|
|
|
2021-01-24 13:09:28 -05:00
|
|
|
describe(`${types.SET_JIRA_ISSUE_TYPES}`, () => {
|
|
|
|
it('sets jiraIssueTypes', () => {
|
|
|
|
const jiraIssueTypes = ['issue', 'epic'];
|
|
|
|
mutations[types.SET_JIRA_ISSUE_TYPES](state, jiraIssueTypes);
|
|
|
|
|
|
|
|
expect(state.jiraIssueTypes).toBe(jiraIssueTypes);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe(`${types.SET_IS_LOADING_JIRA_ISSUE_TYPES}`, () => {
|
|
|
|
it.each([true, false])('sets isLoadingJiraIssueTypes to "%s"', (isLoading) => {
|
|
|
|
mutations[types.SET_IS_LOADING_JIRA_ISSUE_TYPES](state, isLoading);
|
|
|
|
|
|
|
|
expect(state.isLoadingJiraIssueTypes).toBe(isLoading);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe(`${types.SET_JIRA_ISSUE_TYPES_ERROR_MESSAGE}`, () => {
|
|
|
|
it('sets loadingJiraIssueTypesErrorMessage', () => {
|
|
|
|
const errorMessage = 'something went wrong';
|
|
|
|
mutations[types.SET_JIRA_ISSUE_TYPES_ERROR_MESSAGE](state, errorMessage);
|
|
|
|
|
|
|
|
expect(state.loadingJiraIssueTypesErrorMessage).toBe(errorMessage);
|
|
|
|
});
|
|
|
|
});
|
2020-07-16 23:09:14 -04:00
|
|
|
});
|