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