Commit a72f4ecb authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken tests - use the corrent event when button is clicked

parent eed2812f
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
methods: { methods: {
onClickAction() { onClickAction() {
$(this.$el).tooltip('hide'); $(this.$el).tooltip('hide');
eventHub.$emit('graphAction', this.link); eventHub.$emit('postAction', this.link);
this.linkRequested = this.link; this.linkRequested = this.link;
this.isDisabled = true; this.isDisabled = true;
}, },
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
v-tooltip v-tooltip
:title="tooltipText" :title="tooltipText"
class="js-ci-action btn btn-blank class="js-ci-action btn btn-blank
btn-transparent ci-action-icon-container ci-action-icon-wrapper js-ci-action-icon" btn-transparent ci-action-icon-container ci-action-icon-wrapper"
:class="cssClass" :class="cssClass"
data-container="body" data-container="body"
:disabled="isDisabled" :disabled="isDisabled"
......
...@@ -117,7 +117,8 @@ export default { ...@@ -117,7 +117,8 @@ export default {
*/ */
stopDropdownClickPropagation() { stopDropdownClickPropagation() {
$( $(
this.$el.querySelectorAll('.js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item'), '.js-builds-dropdown-list button, .js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item',
this.$el,
).on('click', e => { ).on('click', e => {
e.stopPropagation(); e.stopPropagation();
}); });
......
...@@ -29,10 +29,10 @@ export default () => { ...@@ -29,10 +29,10 @@ export default () => {
}; };
}, },
created() { created() {
eventHub.$on('graphAction', this.postAction); eventHub.$on('postAction', this.postAction);
}, },
beforeDestroy() { beforeDestroy() {
eventHub.$off('graphAction', this.postAction); eventHub.$off('postAction', this.postAction);
}, },
methods: { methods: {
postAction(action) { postAction(action) {
......
...@@ -388,9 +388,9 @@ describe 'Pipelines', :js do ...@@ -388,9 +388,9 @@ describe 'Pipelines', :js do
it 'should be possible to cancel pending build' do it 'should be possible to cancel pending build' do
find('.js-builds-dropdown-button').click find('.js-builds-dropdown-button').click
find('.js-ci-action-icon').click find('.js-ci-action').click
wait_for_requests
expect(page).to have_content('canceled')
expect(build.reload).to be_canceled expect(build.reload).to be_canceled
end end
end end
...@@ -407,7 +407,7 @@ describe 'Pipelines', :js do ...@@ -407,7 +407,7 @@ describe 'Pipelines', :js do
within('.js-builds-dropdown-list') do within('.js-builds-dropdown-list') do
build_element = page.find('.mini-pipeline-graph-dropdown-item') build_element = page.find('.mini-pipeline-graph-dropdown-item')
expect(build_element['data-title']).to eq('build - failed <br> (unknown failure)') expect(build_element['data-original-title']).to eq('build - failed <br> (unknown failure)')
end end
end end
end end
......
...@@ -22,7 +22,7 @@ describe('pipeline graph action component', () => { ...@@ -22,7 +22,7 @@ describe('pipeline graph action component', () => {
}); });
it('should emit an event with the provided link', () => { it('should emit an event with the provided link', () => {
eventHub.$on('graphAction', link => { eventHub.$on('postAction', link => {
expect(link).toEqual('foo'); expect(link).toEqual('foo');
}); });
}); });
......
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