2021-12-11 22:18:48 +05:30
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import { GlAlert, GlLink } from '@gitlab/ui';
|
|
|
|
import IncubationBanner from '~/google_cloud/components/incubation_banner.vue';
|
|
|
|
|
2022-08-13 15:12:31 +05:30
|
|
|
describe('google_cloud/components/incubation_banner', () => {
|
2021-12-11 22:18:48 +05:30
|
|
|
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(() => {
|
2022-08-13 15:12:31 +05:30
|
|
|
wrapper = mount(IncubationBanner);
|
2021-12-11 22:18:48 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
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();
|
2022-08-13 15:12:31 +05:30
|
|
|
const expected =
|
|
|
|
'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=feature_request';
|
2021-12-11 22:18:48 +05:30
|
|
|
expect(link.text()).toBe('request a feature');
|
2022-08-13 15:12:31 +05:30
|
|
|
expect(link.attributes('href')).toBe(expected);
|
2021-12-11 22:18:48 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('contains report bug link', () => {
|
|
|
|
const link = findReportBugLink();
|
2022-08-13 15:12:31 +05:30
|
|
|
const expected =
|
|
|
|
'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=report_bug';
|
2021-12-11 22:18:48 +05:30
|
|
|
expect(link.text()).toBe('report a bug');
|
2022-08-13 15:12:31 +05:30
|
|
|
expect(link.attributes('href')).toBe(expected);
|
2021-12-11 22:18:48 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('contains share feedback link', () => {
|
|
|
|
const link = findShareFeedbackLink();
|
2022-08-13 15:12:31 +05:30
|
|
|
const expected =
|
|
|
|
'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=general_feedback';
|
2021-12-11 22:18:48 +05:30
|
|
|
expect(link.text()).toBe('share feedback');
|
2022-08-13 15:12:31 +05:30
|
|
|
expect(link.attributes('href')).toBe(expected);
|
2021-12-11 22:18:48 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|