blob: 1783538beb3544eff6fe835d4f109ca144b87e5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);
});
});
|