Commit d2007ee6 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Try to fix tests

parent 3176e298
......@@ -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();
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment