diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-04 15:07:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-04 15:07:32 +0300 |
commit | 48bfbd4f1866c43c121543fb2b3db1b07958b460 (patch) | |
tree | 29088cba64c055d0debff9c24f8c3d3c866c7b3b /spec/frontend/vue_shared/components/incubation | |
parent | 4ba8e68892892de8366ce8ad677fbfe6dbae64c9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/incubation')
-rw-r--r-- | spec/frontend/vue_shared/components/incubation/incubation_alert_spec.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/incubation/incubation_alert_spec.js b/spec/frontend/vue_shared/components/incubation/incubation_alert_spec.js new file mode 100644 index 00000000000..1783538beb3 --- /dev/null +++ b/spec/frontend/vue_shared/components/incubation/incubation_alert_spec.js @@ -0,0 +1,34 @@ +import { mount } from '@vue/test-utils'; +import { GlAlert, GlButton } from '@gitlab/ui'; +import IncubationAlert from '~/vue_shared/components/incubation/incubation_alert.vue'; + +describe('IncubationAlert', () => { + let wrapper; + + const findAlert = () => wrapper.findComponent(GlAlert); + + const findButton = () => wrapper.findComponent(GlButton); + + beforeEach(() => { + wrapper = mount(IncubationAlert, { + propsData: { + featureName: 'some feature', + linkToFeedbackIssue: 'some_link', + }, + }); + }); + + it('displays the feature name in the title', () => { + expect(wrapper.html()).toContain('some feature is in incubating phase'); + }); + + it('displays link to issue', () => { + expect(findButton().attributes().href).toBe('some_link'); + }); + + it('is removed if dismissed', async () => { + await wrapper.find('[aria-label="Dismiss"]').trigger('click'); + + expect(findAlert().exists()).toBe(false); + }); +}); |