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

23 lines
656 B
JavaScript
Raw Normal View History

import Vue from 'vue';
2017-04-20 05:04:06 -04:00
import externalUrlComp from '~/environments/components/environment_external_url.vue';
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();
});
});