diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-30 12:08:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-30 12:08:39 +0300 |
commit | 6462f5216f381ffb04665581e71b70e859a6f398 (patch) | |
tree | 980c4c4bf913fae0316a1b7fcf63ddfcfd7b762d /spec/frontend/alerts_settings | |
parent | d91998617f3825e906b35f4406d641af7f59e832 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/alerts_settings')
-rw-r--r-- | spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap | 5 | ||||
-rw-r--r-- | spec/frontend/alerts_settings/alerts_settings_form_new_spec.js | 23 |
2 files changed, 25 insertions, 3 deletions
diff --git a/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap b/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap index 68328ef3518..c553787d2c0 100644 --- a/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap +++ b/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap @@ -4,12 +4,13 @@ exports[`AlertsSettingsFormNew with default values renders the initial template "<gl-form-stub class=\\"gl-mt-6\\"> <h5 class=\\"gl-font-lg gl-my-5\\">Add new integrations</h5> <gl-form-group-stub id=\\"integration-type\\" label=\\"1. Select integration type\\" label-for=\\"integration-type\\"> - <gl-form-select-stub id=\\"integration-type\\" options=\\"[object Object],[object Object],[object Object],[object Object]\\" value=\\"\\"></gl-form-select-stub> <span class=\\"gl-text-gray-500\\"><gl-sprintf-stub message=\\"Learn more about our upcoming %{linkStart}integrations%{linkEnd}\\"></gl-sprintf-stub></span> + <gl-form-select-stub options=\\"[object Object],[object Object],[object Object],[object Object]\\" value=\\"\\"></gl-form-select-stub> <span class=\\"gl-text-gray-500\\"><gl-sprintf-stub message=\\"Learn more about our upcoming %{linkStart}integrations%{linkEnd}\\"></gl-sprintf-stub></span> </gl-form-group-stub> <b-collapse-stub tag=\\"div\\" class=\\"gl-mt-3\\"> <gl-form-group-stub id=\\"name-integration\\" label=\\"2. Name integration\\" label-for=\\"name-integration\\"> - <b-form-input-stub id=\\"name-integration\\" value=\\"\\" placeholder=\\"Enter integration name\\" debounce=\\"0\\" type=\\"text\\" class=\\"gl-form-input\\"></b-form-input-stub> + <b-form-input-stub value=\\"\\" placeholder=\\"Enter integration name\\" debounce=\\"0\\" type=\\"text\\" class=\\"gl-form-input\\"></b-form-input-stub> </gl-form-group-stub> + <!----> <div class=\\"gl-display-flex gl-justify-content-end\\"> <gl-button-stub category=\\"primary\\" variant=\\"default\\" size=\\"medium\\" icon=\\"\\" buttontextclasses=\\"\\" type=\\"reset\\" class=\\"gl-mr-3 js-no-auto-disable\\">Cancel</gl-button-stub> <gl-button-stub category=\\"secondary\\" variant=\\"success\\" size=\\"medium\\" icon=\\"\\" buttontextclasses=\\"\\" type=\\"submit\\" class=\\"gl-mr-1 js-no-auto-disable\\">Save and test payload</gl-button-stub> diff --git a/spec/frontend/alerts_settings/alerts_settings_form_new_spec.js b/spec/frontend/alerts_settings/alerts_settings_form_new_spec.js index 50038ecb9ff..a71560d9c7c 100644 --- a/spec/frontend/alerts_settings/alerts_settings_form_new_spec.js +++ b/spec/frontend/alerts_settings/alerts_settings_form_new_spec.js @@ -6,12 +6,17 @@ import { defaultAlertSettingsConfig } from './util'; describe('AlertsSettingsFormNew', () => { let wrapper; - const createComponent = ({ methods } = {}, data) => { + const createComponent = ( + { methods } = {}, + data, + multipleHttpIntegrationsCustomMapping = false, + ) => { wrapper = shallowMount(AlertsSettingsForm, { data() { return { ...data }; }, provide: { + glFeatures: { multipleHttpIntegrationsCustomMapping }, ...defaultAlertSettingsConfig, }, methods, @@ -23,6 +28,7 @@ describe('AlertsSettingsFormNew', () => { const findSelect = () => wrapper.find(GlFormSelect); const findFormSteps = () => wrapper.find(GlCollapse); const findFormName = () => wrapper.find(GlFormInput); + const findMappingBuilderSection = () => wrapper.find(`[id = "mapping-builder"]`); afterEach(() => { if (wrapper) { @@ -54,4 +60,19 @@ describe('AlertsSettingsFormNew', () => { expect(findFormName().isVisible()).toBe(true); }); }); + + describe('Mapping builder section', () => { + beforeEach(() => { + createComponent({}, {}); + }); + + it('should NOT render when feature flag disabled', () => { + expect(findMappingBuilderSection().exists()).toBe(false); + }); + + it('should render when feature flag is enabled', () => { + createComponent({}, {}, true); + expect(findMappingBuilderSection().exists()).toBe(true); + }); + }); }); |