debian-mirror-gitlab/spec/frontend/projects/clusters_deprecation_slert/components/clusters_deprecation_alert_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1 KiB
JavaScript
Raw Normal View History

2022-07-23 23:45:48 +05:30
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();
});
afterEach(() => {
wrapper.destroy();
});
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);
});
});
});