Commit de65cca0 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch...

Merge branch '25188-unable-to-expand-collapse-files-in-merge-request-by-clicking-caret' into 'master'

Fix unable to expand or collapse files in merge request by clicking caret

Closes #25188

See merge request gitlab-org/gitlab!19222
parents e3b83f06 0e30f242
......@@ -61,7 +61,7 @@ export default {
</script>
<template>
<svg :class="[iconSizeClass, iconTestClass]" aria-hidden="true">
<svg :class="[iconSizeClass, iconTestClass]" aria-hidden="true" v-on="$listeners">
<use v-bind="{ 'xlink:href': spriteHref }" />
</svg>
</template>
---
title: Fix unable to expand or collapse files in merge request by clicking caret
merge_request: 19222
author: Brian T
type: fixed
import Vue from 'vue';
import Icon from '~/vue_shared/components/icon.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { mount } from '@vue/test-utils';
describe('Sprite Icon Component', function() {
describe('Initialization', function() {
......@@ -57,4 +58,16 @@ describe('Sprite Icon Component', function() {
expect(Icon.props.name.validator('commit')).toBe(true);
});
});
it('should call registered listeners when they are triggered', () => {
const clickHandler = jasmine.createSpy('clickHandler');
const wrapper = mount(Icon, {
propsData: { name: 'commit' },
listeners: { click: clickHandler },
});
wrapper.find('svg').trigger('click');
expect(clickHandler).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