gitlab-org--gitlab-foss/spec/javascripts/environments/environment_external_url_spec.js

23 lines
652 B
JavaScript
Raw Normal View History

import Vue from 'vue';
import externalUrlComp from '~/environments/components/environment_external_url';
describe('External URL Component', () => {
let ExternalUrlComponent;
beforeEach(() => {
ExternalUrlComponent = Vue.extend(externalUrlComp);
});
2016-12-08 07:06:49 -05:00
it('should link to the provided externalUrl prop', () => {
const externalURL = 'https://gitlab.com';
2017-02-09 06:52:22 -05:00
const component = new ExternalUrlComponent({
propsData: {
2016-12-08 06:54:08 -05:00
externalUrl: externalURL,
},
}).$mount();
expect(component.$el.getAttribute('href')).toEqual(externalURL);
expect(component.$el.querySelector('fa-external-link')).toBeDefined();
});
});