diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/frontend/google_cloud/components/incubation_banner_spec.js | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/frontend/google_cloud/components/incubation_banner_spec.js')
-rw-r--r-- | spec/frontend/google_cloud/components/incubation_banner_spec.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/frontend/google_cloud/components/incubation_banner_spec.js b/spec/frontend/google_cloud/components/incubation_banner_spec.js new file mode 100644 index 00000000000..89517be4ef1 --- /dev/null +++ b/spec/frontend/google_cloud/components/incubation_banner_spec.js @@ -0,0 +1,60 @@ +import { mount } from '@vue/test-utils'; +import { GlAlert, GlLink } from '@gitlab/ui'; +import IncubationBanner from '~/google_cloud/components/incubation_banner.vue'; + +describe('IncubationBanner component', () => { + let wrapper; + + const findAlert = () => wrapper.findComponent(GlAlert); + const findLinks = () => wrapper.findAllComponents(GlLink); + const findFeatureRequestLink = () => findLinks().at(0); + const findReportBugLink = () => findLinks().at(1); + const findShareFeedbackLink = () => findLinks().at(2); + + beforeEach(() => { + const propsData = { + shareFeedbackUrl: 'url_general_feedback', + reportBugUrl: 'url_report_bug', + featureRequestUrl: 'url_feature_request', + }; + wrapper = mount(IncubationBanner, { propsData }); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('contains alert', () => { + expect(findAlert().exists()).toBe(true); + }); + + it('contains relevant text', () => { + expect(findAlert().text()).toContain( + 'This is an experimental feature developed by GitLab Incubation Engineering.', + ); + }); + + describe('has relevant gl-links', () => { + it('three in total', () => { + expect(findLinks().length).toBe(3); + }); + + it('contains feature request link', () => { + const link = findFeatureRequestLink(); + expect(link.text()).toBe('request a feature'); + expect(link.attributes('href')).toBe('url_feature_request'); + }); + + it('contains report bug link', () => { + const link = findReportBugLink(); + expect(link.text()).toBe('report a bug'); + expect(link.attributes('href')).toBe('url_report_bug'); + }); + + it('contains share feedback link', () => { + const link = findShareFeedbackLink(); + expect(link.text()).toBe('share feedback'); + expect(link.attributes('href')).toBe('url_general_feedback'); + }); + }); +}); |