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