blob: 2cccbb3b63cc7dc761b3909efab8e6b9c19ffafd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { mount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui';
import ExternalUrlComp from '~/environments/components/environment_external_url.vue';
describe('External URL Component', () => {
let wrapper;
const externalUrl = 'https://gitlab.com';
beforeEach(() => {
wrapper = mount(ExternalUrlComp, { propsData: { externalUrl } });
});
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);
});
});
|