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

22 lines
715 B
JavaScript
Raw Normal View History

require('~/environments/components/environment_external_url');
describe('External URL Component', () => {
preloadFixtures('static/environments/element.html.raw');
beforeEach(() => {
loadFixtures('static/environments/element.html.raw');
});
2016-12-08 07:06:49 -05:00
it('should link to the provided externalUrl prop', () => {
const externalURL = 'https://gitlab.com';
const component = new window.gl.environmentsList.ExternalUrlComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
2016-12-08 06:54:08 -05:00
externalUrl: externalURL,
},
});
expect(component.$el.getAttribute('href')).toEqual(externalURL);
expect(component.$el.querySelector('fa-external-link')).toBeDefined();
});
});