summaryrefslogtreecommitdiff
path: root/spec/javascripts/environments
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-19 13:07:13 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-19 13:07:13 +0000
commit6e5a1ea02ad929b5c7d5f4c69405281428a26a11 (patch)
tree12f6041d690381604b735b7716c0d66f58d26994 /spec/javascripts/environments
parentf9a662c38fc8bbcee66ab08db53f86bdad146784 (diff)
downloadgitlab-ce-6e5a1ea02ad929b5c7d5f4c69405281428a26a11.tar.gz
Fix broken test
Diffstat (limited to 'spec/javascripts/environments')
-rw-r--r--spec/javascripts/environments/environment_stop_spec.js.es620
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/environments/environment_stop_spec.js.es6 b/spec/javascripts/environments/environment_stop_spec.js.es6
index 37fba925e16..3502914dbd6 100644
--- a/spec/javascripts/environments/environment_stop_spec.js.es6
+++ b/spec/javascripts/environments/environment_stop_spec.js.es6
@@ -16,4 +16,24 @@ describe('Stop Component', () => {
});
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;
+
+ spyOn(window, 'confirm').and.callFake(function () {
+ opened = true;
+ expect(opened).toEqual(true);
+ return false;
+ });
+ component.$el.click();
+ });
+ });
});