Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/javascripts/environments/environment_stop_spec.js.es633
1 files changed, 11 insertions, 22 deletions
diff --git a/spec/javascripts/environments/environment_stop_spec.js.es6 b/spec/javascripts/environments/environment_stop_spec.js.es6
index 3502914dbd6..b842be4da61 100644
--- a/spec/javascripts/environments/environment_stop_spec.js.es6
+++ b/spec/javascripts/environments/environment_stop_spec.js.es6
@@ -2,38 +2,27 @@
//= require environments/components/environment_stop
describe('Stop Component', () => {
fixture.preload('environments/element.html');
+
+ let stopURL;
+ let component;
+
beforeEach(() => {
fixture.load('environments/element.html');
- });
- it('should link to the provided URL', () => {
- const stopURL = '/stop';
- const component = new window.gl.environmentsList.StopComponent({
+ stopURL = '/stop';
+ component = new window.gl.environmentsList.StopComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
stop_url: stopURL,
},
});
- expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
- describe('When clicked', () => {
- it('Should open popup with confirmation warning', () => {
- const component = new window.gl.environmentsList.StopComponent({
- el: document.querySelector('.test-dom-element'),
- propsData: {
- stop_url: '#',
- },
- });
-
- let opened = false;
+ it('should link to the provided URL', () => {
+ expect(component.$el.getAttribute('href')).toEqual(stopURL);
+ });
- spyOn(window, 'confirm').and.callFake(function () {
- opened = true;
- expect(opened).toEqual(true);
- return false;
- });
- component.$el.click();
- });
+ it('should have a data-confirm attribute', () => {
+ expect(component.$el.getAttribute('data-confirm')).toEqual('Are you sure you want to stop this environment?');
});
});