diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-19 13:07:13 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-11-19 13:07:13 +0000 |
commit | 6e5a1ea02ad929b5c7d5f4c69405281428a26a11 (patch) | |
tree | 12f6041d690381604b735b7716c0d66f58d26994 /spec/javascripts | |
parent | f9a662c38fc8bbcee66ab08db53f86bdad146784 (diff) | |
download | gitlab-ce-6e5a1ea02ad929b5c7d5f4c69405281428a26a11.tar.gz |
Fix broken test
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/environments/environment_stop_spec.js.es6 | 20 |
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(); + }); + }); }); |