30c6a7d3ac
Adds tests. Changes instance into a constructor Adds tests for environments component Adds tests assertations Adds external URL test Adds tests for Rollback component Adds tests for stop component Adds tests for actions component Fix environment item Init environment item tests
22 lines
704 B
JavaScript
22 lines
704 B
JavaScript
//= require vue
|
|
//= require environments/components/environment_external_url
|
|
|
|
describe('External URL Component', () => {
|
|
fixture.preload('environments/element.html');
|
|
beforeEach(() => {
|
|
fixture.load('environments/element.html');
|
|
});
|
|
|
|
it('should link to the provided external_url', () => {
|
|
const externalURL = 'https://gitlab.com';
|
|
const component = new window.gl.environmentsList.ExternalUrlComponent({
|
|
el: document.querySelector('.test-dom-element'),
|
|
propsData: {
|
|
external_url: externalURL,
|
|
},
|
|
});
|
|
|
|
expect(component.$el.getAttribute('href')).toEqual(externalURL);
|
|
expect(component.$el.querySelector('fa-external-link')).toBeDefined();
|
|
});
|
|
});
|