Changes for stop url to path
This commit is contained in:
parent
d2007ee6dd
commit
f9a662c38f
|
@ -13,12 +13,6 @@
|
|||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
stopUrl() {
|
||||
return this.stop_url;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
openConfirmDialog() {
|
||||
return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line
|
||||
|
@ -28,7 +22,7 @@
|
|||
template: `
|
||||
<a v-on:click="openConfirmDialog"
|
||||
class="btn stop-env-link"
|
||||
:href="stopUrl"
|
||||
:href="stop_url"
|
||||
data-method="post"
|
||||
rel="nofollow">
|
||||
<i class="fa fa-stop stop-env-icon"></i>
|
||||
|
|
|
@ -16,20 +16,4 @@ 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: '#',
|
||||
},
|
||||
});
|
||||
|
||||
var confirm = spyOn(window, 'confirm');
|
||||
confirm.and.returnValue(false);
|
||||
component.$el.click();
|
||||
expect(confirm).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue