2020-10-24 23:57:45 +05:30
|
|
|
import { mount } from '@vue/test-utils';
|
2023-07-09 08:55:56 +05:30
|
|
|
import { GlButton } from '@gitlab/ui';
|
2020-03-13 15:44:24 +05:30
|
|
|
import ExternalUrlComp from '~/environments/components/environment_external_url.vue';
|
|
|
|
|
|
|
|
describe('External URL Component', () => {
|
|
|
|
let wrapper;
|
2023-07-09 08:55:56 +05:30
|
|
|
const externalUrl = 'https://gitlab.com';
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
wrapper = mount(ExternalUrlComp, { propsData: { externalUrl } });
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
it('should link to the provided externalUrl prop', () => {
|
|
|
|
const button = wrapper.findComponent(GlButton);
|
|
|
|
expect(button.attributes('href')).toEqual(externalUrl);
|
|
|
|
expect(button.props('isUnsafeLink')).toBe(true);
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
});
|