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

29 lines
767 B
JavaScript
Raw Normal View History

2017-02-09 06:52:22 -05:00
const StopComponent = require('~/environments/components/environment_stop');
2016-12-29 16:42:48 -05:00
describe('Stop Component', () => {
preloadFixtures('static/environments/element.html.raw');
2016-11-19 08:29:48 -05:00
let stopURL;
let component;
beforeEach(() => {
loadFixtures('static/environments/element.html.raw');
2016-11-19 08:29:48 -05:00
stopURL = '/stop';
2017-02-09 06:52:22 -05:00
component = new StopComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
2016-12-08 06:54:08 -05:00
stopUrl: stopURL,
},
});
});
2016-11-19 08:07:13 -05:00
2016-11-19 08:29:48 -05:00
it('should link to the provided URL', () => {
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
2016-11-19 08:07:13 -05:00
2016-11-19 08:29:48 -05: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 08:07:13 -05:00
});
});