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

29 lines
764 B
JavaScript
Raw Normal View History

//= require vue
//= require environments/components/environment_stop
describe('Stop Component', () => {
fixture.preload('environments/element.html');
2016-11-19 13:29:48 +00:00
let stopURL;
let component;
beforeEach(() => {
fixture.load('environments/element.html');
2016-11-19 13:29:48 +00:00
stopURL = '/stop';
component = new window.gl.environmentsList.StopComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
stop_url: stopURL,
},
});
});
2016-11-19 13:07:13 +00:00
2016-11-19 13:29:48 +00:00
it('should link to the provided URL', () => {
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
2016-11-19 13:07:13 +00:00
2016-11-19 13:29:48 +00:00
it('should have a data-confirm attribute', () => {
expect(component.$el.getAttribute('data-confirm')).toEqual('Are you sure you want to stop this environment?');
2016-11-19 13:07:13 +00:00
});
});