diff options
Diffstat (limited to 'spec/frontend/environments/environment_form_spec.js')
-rw-r--r-- | spec/frontend/environments/environment_form_spec.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/frontend/environments/environment_form_spec.js b/spec/frontend/environments/environment_form_spec.js index f1af08bcf32..b9b34bee80f 100644 --- a/spec/frontend/environments/environment_form_spec.js +++ b/spec/frontend/environments/environment_form_spec.js @@ -10,11 +10,14 @@ const DEFAULT_PROPS = { cancelPath: '/cancel', }; +const PROVIDE = { protectedEnvironmentSettingsPath: '/projects/not_real/settings/ci_cd' }; + describe('~/environments/components/form.vue', () => { let wrapper; const createWrapper = (propsData = {}) => mountExtended(EnvironmentForm, { + provide: PROVIDE, propsData: { ...DEFAULT_PROPS, ...propsData, @@ -31,7 +34,7 @@ describe('~/environments/components/form.vue', () => { }); it('links to documentation regarding environments', () => { - const link = wrapper.findByRole('link', { name: 'More information' }); + const link = wrapper.findByRole('link', { name: 'More information.' }); expect(link.attributes('href')).toBe('/help/ci/environments/index.md'); }); @@ -124,6 +127,10 @@ describe('~/environments/components/form.vue', () => { expect(urlInput.element.value).toBe(''); }); + + 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', () => { |