diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-28 15:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-28 15:10:10 +0300 |
commit | 22fd199237e247c36de5b982d444cedc194126e6 (patch) | |
tree | 1a5ad68a1dffdf37dfae0d1267bf3bcc04c292cb /spec/frontend/integrations | |
parent | 97b93f6d05b26e57a4d6a6d33a46aacb5f3235a6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/integrations')
-rw-r--r-- | spec/frontend/integrations/edit/components/integration_form_spec.js | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/spec/frontend/integrations/edit/components/integration_form_spec.js b/spec/frontend/integrations/edit/components/integration_form_spec.js index 7e67379f5ab..17a08da0a07 100644 --- a/spec/frontend/integrations/edit/components/integration_form_spec.js +++ b/spec/frontend/integrations/edit/components/integration_form_spec.js @@ -760,30 +760,38 @@ describe('IntegrationForm', () => { ); }); - it.each` - prefix | integration | shouldUpgradeSlack | flagIsOn | shouldShowAlert - ${'does'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${true} | ${true} | ${true} - ${'does not'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${false} | ${true} | ${false} - ${'does not'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${true} | ${false} | ${false} - ${'does not'} | ${'foo'} | ${true} | ${true} | ${false} - ${'does not'} | ${'foo'} | ${false} | ${true} | ${false} - ${'does not'} | ${'foo'} | ${true} | ${false} | ${false} - `( - '$prefix render the upgrade warnning when we are in "$integration" integration with the flag "$flagIsOn" and Slack-needs-upgrade is "$shouldUpgradeSlack"', - ({ integration, shouldUpgradeSlack, flagIsOn, shouldShowAlert }) => { - createComponent({ - provide: { - glFeatures: { integrationSlackAppNotifications: flagIsOn }, - }, - customStateProps: { - shouldUpgradeSlack, - type: integration, - sections: [mockSectionConnection], - }, - }); - expect(findAlert().exists()).toBe(shouldShowAlert); - }, - ); + describe.each` + hasSections | hasFieldsWithoutSections | description + ${true} | ${true} | ${'When having both: the sections and the fields without a section'} + ${true} | ${false} | ${'When having the sections only'} + ${false} | ${true} | ${'When having only the fields without a section'} + `('$description', ({ hasSections, hasFieldsWithoutSections }) => { + it.each` + prefix | integration | shouldUpgradeSlack | flagIsOn | shouldShowAlert + ${'does'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${true} | ${true} | ${true} + ${'does not'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${false} | ${true} | ${false} + ${'does not'} | ${INTEGRATION_FORM_TYPE_SLACK} | ${true} | ${false} | ${false} + ${'does not'} | ${'foo'} | ${true} | ${true} | ${false} + ${'does not'} | ${'foo'} | ${false} | ${true} | ${false} + ${'does not'} | ${'foo'} | ${true} | ${false} | ${false} + `( + '$prefix render the upgrade warning when we are in "$integration" integration with the flag "$flagIsOn" and Slack-needs-upgrade is "$shouldUpgradeSlack" and have sections', + ({ integration, shouldUpgradeSlack, flagIsOn, shouldShowAlert }) => { + createComponent({ + provide: { + glFeatures: { integrationSlackAppNotifications: flagIsOn }, + }, + customStateProps: { + shouldUpgradeSlack, + type: integration, + sections: hasSections ? [mockSectionConnection] : [], + fields: hasFieldsWithoutSections ? [mockField] : [], + }, + }); + expect(findAlert().exists()).toBe(shouldShowAlert); + }, + ); + }); }); }); }); |