blob: 68ea3a4dc4ddbf9b0e8b03ac0278212b0755debe (
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
35
36
37
38
39
40
41
|
import { GlAlert, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import ClustersDeprecationAlert from '~/projects/clusters_deprecation_alert/components/clusters_deprecation_alert.vue';
const message = 'Alert message';
describe('ClustersDeprecationAlert', () => {
let wrapper;
const provideData = {
message,
};
const findAlert = () => wrapper.findComponent(GlAlert);
const createComponent = () => {
wrapper = shallowMount(ClustersDeprecationAlert, {
provide: provideData,
stubs: {
GlSprintf,
},
});
};
beforeEach(() => {
createComponent();
});
describe('template', () => {
it('should render a non-dismissible warning alert', () => {
expect(findAlert().props()).toMatchObject({
dismissible: false,
variant: 'warning',
});
});
it('should display the correct message', () => {
expect(findAlert().text()).toBe(message);
});
});
});
|