diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 15:07:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 15:07:59 +0300 |
commit | fd27e4f95b3ea8668e1e67f5a88dfb061909c893 (patch) | |
tree | 439bcc5417be41cd2290485292fe512f6cea8110 /spec/frontend/integrations | |
parent | 6aa920eeb4ef61ea7e7c77b5e10595507874b927 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/integrations')
3 files changed, 91 insertions, 0 deletions
diff --git a/spec/frontend/integrations/edit/components/integration_form_spec.js b/spec/frontend/integrations/edit/components/integration_form_spec.js index 51b3a9752a7..c4569070d09 100644 --- a/spec/frontend/integrations/edit/components/integration_form_spec.js +++ b/spec/frontend/integrations/edit/components/integration_form_spec.js @@ -435,6 +435,29 @@ describe('IntegrationForm', () => { }); }, ); + + describe('when IntegrationSectionConnection emits `request-jira-issue-types` event', () => { + beforeEach(() => { + jest.spyOn(document, 'querySelector').mockReturnValue(document.createElement('form')); + + createComponent({ + provide: { + glFeatures: { integrationFormSections: true }, + }, + customStateProps: { + sections: [mockSectionConnection], + testPath: '/test', + }, + mountFn: mountExtended, + }); + + findConnectionSectionComponent().vm.$emit('request-jira-issue-types'); + }); + + it('dispatches `requestJiraIssueTypes` action', () => { + expect(dispatch).toHaveBeenCalledWith('requestJiraIssueTypes', expect.any(FormData)); + }); + }); }); describe('ActiveCheckbox', () => { diff --git a/spec/frontend/integrations/edit/components/sections/jira_issues_spec.js b/spec/frontend/integrations/edit/components/sections/jira_issues_spec.js new file mode 100644 index 00000000000..a7c1cc2a03f --- /dev/null +++ b/spec/frontend/integrations/edit/components/sections/jira_issues_spec.js @@ -0,0 +1,34 @@ +import { shallowMount } from '@vue/test-utils'; + +import IntegrationSectionJiraIssue from '~/integrations/edit/components/sections/jira_issues.vue'; +import JiraIssuesFields from '~/integrations/edit/components/jira_issues_fields.vue'; +import { createStore } from '~/integrations/edit/store'; + +import { mockIntegrationProps } from '../../mock_data'; + +describe('IntegrationSectionJiraIssue', () => { + let wrapper; + + const createComponent = () => { + const store = createStore({ + customState: { ...mockIntegrationProps }, + }); + wrapper = shallowMount(IntegrationSectionJiraIssue, { + store, + }); + }; + + afterEach(() => { + wrapper.destroy(); + }); + + const findJiraIssuesFields = () => wrapper.findComponent(JiraIssuesFields); + + describe('template', () => { + it('renders JiraIssuesFields', () => { + createComponent(); + + expect(findJiraIssuesFields().exists()).toBe(true); + }); + }); +}); diff --git a/spec/frontend/integrations/edit/components/sections/jira_trigger_spec.js b/spec/frontend/integrations/edit/components/sections/jira_trigger_spec.js new file mode 100644 index 00000000000..d4ab9864fab --- /dev/null +++ b/spec/frontend/integrations/edit/components/sections/jira_trigger_spec.js @@ -0,0 +1,34 @@ +import { shallowMount } from '@vue/test-utils'; + +import IntegrationSectionJiraTrigger from '~/integrations/edit/components/sections/jira_trigger.vue'; +import JiraTriggerFields from '~/integrations/edit/components/jira_trigger_fields.vue'; +import { createStore } from '~/integrations/edit/store'; + +import { mockIntegrationProps } from '../../mock_data'; + +describe('IntegrationSectionJiraTrigger', () => { + let wrapper; + + const createComponent = () => { + const store = createStore({ + customState: { ...mockIntegrationProps }, + }); + wrapper = shallowMount(IntegrationSectionJiraTrigger, { + store, + }); + }; + + afterEach(() => { + wrapper.destroy(); + }); + + const findJiraTriggerFields = () => wrapper.findComponent(JiraTriggerFields); + + describe('template', () => { + it('renders JiraTriggerFields', () => { + createComponent(); + + expect(findJiraTriggerFields().exists()).toBe(true); + }); + }); +}); |