From d2007ee6ddaf665170bac0ed63fc1a3ab92b04db Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 18 Nov 2016 23:02:09 +0100 Subject: [PATCH] Try to fix tests --- .../environments/environment_stop_spec.js.es6 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/javascripts/environments/environment_stop_spec.js.es6 b/spec/javascripts/environments/environment_stop_spec.js.es6 index 20eb8c92322..d3eff278292 100644 --- a/spec/javascripts/environments/environment_stop_spec.js.es6 +++ b/spec/javascripts/environments/environment_stop_spec.js.es6 @@ -7,14 +7,14 @@ describe('Stop Component', () => { }); it('should link to the provided URL', () => { - const stopURL = 'https://gitlab.com/stop'; + const stopURL = '/stop'; const component = new window.gl.environmentsList.StopComponent({ el: document.querySelector('.test-dom-element'), propsData: { stop_url: stopURL, }, }); - expect(component.$el.getAttribute('href')).toEqual(`${stopURL}/stop`); + expect(component.$el.getAttribute('href')).toEqual(stopURL); }); describe('When clicked', () => { @@ -26,9 +26,10 @@ describe('Stop Component', () => { }, }); - const spy = spyOn(window, 'confirm'); + var confirm = spyOn(window, 'confirm'); + confirm.and.returnValue(false); component.$el.click(); - expect(spy).toHaveBeenCalled(); + expect(confirm).toHaveBeenCalled(); }); }); });