Skip to content
Snippets Groups Projects
Unverified Commit a72f4ecb authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

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

parent eed2812f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -61,7 +61,7 @@ export default {
methods: {
onClickAction() {
$(this.$el).tooltip('hide');
eventHub.$emit('graphAction', this.link);
eventHub.$emit('postAction', this.link);
this.linkRequested = this.link;
this.isDisabled = true;
},
Loading
Loading
@@ -75,7 +75,7 @@ export default {
v-tooltip
:title="tooltipText"
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"
data-container="body"
:disabled="isDisabled"
Loading
Loading
Loading
Loading
@@ -117,7 +117,8 @@ export default {
*/
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 => {
e.stopPropagation();
});
Loading
Loading
Loading
Loading
@@ -29,10 +29,10 @@ export default () => {
};
},
created() {
eventHub.$on('graphAction', this.postAction);
eventHub.$on('postAction', this.postAction);
},
beforeDestroy() {
eventHub.$off('graphAction', this.postAction);
eventHub.$off('postAction', this.postAction);
},
methods: {
postAction(action) {
Loading
Loading
Loading
Loading
@@ -388,9 +388,9 @@ describe 'Pipelines', :js do
 
it 'should be possible to cancel pending build' do
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
end
end
Loading
Loading
@@ -407,7 +407,7 @@ describe 'Pipelines', :js do
 
within('.js-builds-dropdown-list') do
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
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe('pipeline graph action component', () => {
});
 
it('should emit an event with the provided link', () => {
eventHub.$on('graphAction', link => {
eventHub.$on('postAction', link => {
expect(link).toEqual('foo');
});
});
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment