Commit ced2486c authored by Axel García's avatar Axel García

Update events on swimlanes sidebar epic item

It now used "open" instead of "changed"
parent 152b4c65
......@@ -41,10 +41,8 @@ export default {
receiveEpicsSuccess: RECEIVE_EPICS_SUCCESS,
}),
...mapActions(['setActiveIssueEpic']),
handleEdit(isEditing) {
if (isEditing) {
this.$refs.epicSelect.handleEditClick();
}
openEpicsDropdown() {
this.$refs.epicSelect.handleEditClick();
},
async setEpic(selectedEpic) {
this.loading = true;
......@@ -80,7 +78,7 @@ export default {
ref="sidebarItem"
:title="__('Epic')"
:loading="loading"
@changed="handleEdit"
@open="openEpicsDropdown"
>
<template v-if="storedEpic.title" #collapsed>
<a class="gl-text-gray-900! gl-font-weight-bold" href="#">
......
......@@ -40,6 +40,7 @@ describe('ee/boards/components/sidebar/board_sidebar_epic_select.vue', () => {
};
const findEpicSelect = () => wrapper.find({ ref: 'epicSelect' });
const findItemWrapper = () => wrapper.find({ ref: 'sidebarItem' });
const findCollapsed = () => wrapper.find('[data-testid="collapsed-content"]');
it('renders "None" when no epic is selected', () => {
......@@ -47,6 +48,13 @@ describe('ee/boards/components/sidebar/board_sidebar_epic_select.vue', () => {
expect(findCollapsed().text()).toBe('None');
});
it('expands the dropdown when editing', () => {
createWrapper();
wrapper.setMethods({ openEpicsDropdown: jest.fn() });
findItemWrapper().vm.$emit('open');
expect(wrapper.vm.openEpicsDropdown).toHaveBeenCalled();
});
describe('when epic is selected', () => {
beforeEach(async () => {
createWrapper();
......
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