diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 00:12:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 00:12:45 +0300 |
commit | 8ec004d6d8d92f00d0598e94ede4d31ab1e8f18e (patch) | |
tree | 525dcb81832e5ad142cc1f2aeff2f38c51f80aa4 /spec/frontend | |
parent | e22c3819ad2321a0cf825877fe3b60e41268c5b3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
4 files changed, 41 insertions, 7 deletions
diff --git a/spec/frontend/admin/application_settings/network_outbound_spec.js b/spec/frontend/admin/application_settings/network_outbound_spec.js index 0e3a2dfdfd4..2c06a3fd67f 100644 --- a/spec/frontend/admin/application_settings/network_outbound_spec.js +++ b/spec/frontend/admin/application_settings/network_outbound_spec.js @@ -12,7 +12,7 @@ describe('initNetworkOutbound', () => { const createFixture = (denyAll = false) => { setHTMLFixture(` - <input class="js-deny-all-requests" type="checkbox" name="application_setting[deny_all_requests]" ${ + <input class="js-deny-all-requests" type="checkbox" name="application_setting[deny_all_requests_except_allowed]" ${ denyAll ? 'checked="checked"' : '' }/> <div class="js-deny-all-requests-warning ${denyAll ? '' : 'gl-display-none'}"></div> diff --git a/spec/frontend/environments/environment_form_spec.js b/spec/frontend/environments/environment_form_spec.js index b9b34bee80f..00401d759f9 100644 --- a/spec/frontend/environments/environment_form_spec.js +++ b/spec/frontend/environments/environment_form_spec.js @@ -15,9 +15,10 @@ const PROVIDE = { protectedEnvironmentSettingsPath: '/projects/not_real/settings describe('~/environments/components/form.vue', () => { let wrapper; - const createWrapper = (propsData = {}) => + const createWrapper = (propsData = {}, options = {}) => mountExtended(EnvironmentForm, { provide: PROVIDE, + ...options, propsData: { ...DEFAULT_PROPS, ...propsData, @@ -105,6 +106,7 @@ describe('~/environments/components/form.vue', () => { wrapper = createWrapper({ loading: true }); expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); + describe('when a new environment is being created', () => { beforeEach(() => { wrapper = createWrapper({ @@ -133,6 +135,18 @@ describe('~/environments/components/form.vue', () => { }); }); + describe('when no protected environment link is provided', () => { + beforeEach(() => { + wrapper = createWrapper({ + provide: {}, + }); + }); + + it('does not show protected environment documentation', () => { + expect(wrapper.findByRole('link', { name: 'Protected environments' }).exists()).toBe(false); + }); + }); + describe('when an existing environment is being edited', () => { beforeEach(() => { wrapper = createWrapper({ diff --git a/spec/frontend/security_configuration/components/app_spec.js b/spec/frontend/security_configuration/components/app_spec.js index ddefda2ffc3..ee1121abbee 100644 --- a/spec/frontend/security_configuration/components/app_spec.js +++ b/spec/frontend/security_configuration/components/app_spec.js @@ -141,7 +141,7 @@ describe('App component', () => { it('renders main-heading with correct text', () => { const mainHeading = findMainHeading(); expect(mainHeading.exists()).toBe(true); - expect(mainHeading.text()).toContain('Security Configuration'); + expect(mainHeading.text()).toContain('Security configuration'); }); describe('tabs', () => { diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js index 080e3af5254..1e4e089e7c1 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js @@ -180,6 +180,26 @@ describe('ReadyToMerge', () => { expect(wrapper.vm.status).toEqual('failed'); }); }); + + describe('status icon', () => { + it('defaults to tick icon', () => { + createComponent({ mr: { mergeable: true } }); + + expect(wrapper.vm.iconClass).toEqual('success'); + }); + + it('shows tick for success status', () => { + createComponent({ mr: { pipeline: { status: 'SUCCESS' }, mergeable: true } }); + + expect(wrapper.vm.iconClass).toEqual('success'); + }); + + it('shows tick for pending status', () => { + createComponent({ mr: { pipeline: { active: true }, mergeable: true } }); + + expect(wrapper.vm.iconClass).toEqual('success'); + }); + }); }); describe('merge button text', () => { @@ -189,18 +209,18 @@ describe('ReadyToMerge', () => { expect(findMergeButton().text()).toBe('Merge'); }); - it('should return "Set auto-merge" when the MWPS auto merge strategy is available', () => { + it('should return "Merge when pipeline succeeds" when the MWPS auto merge strategy is available', () => { createComponent({ mr: { preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY }, }); - expect(findMergeButton().text()).toBe('Set auto-merge'); + expect(findMergeButton().text()).toBe('Merge when pipeline succeeds'); }); - it('should return set auto-merge', () => { + it('should return Merge when pipeline succeeds', () => { createComponent({ mr: { preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY } }); - expect(findMergeButton().text()).toBe('Set auto-merge'); + expect(findMergeButton().text()).toBe('Merge when pipeline succeeds'); }); }); |