Commit 83624bde authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'apply-event-changes-to-swimlanes-sidebar-epic-item' into 'master'

Update events on Swimlanes sidebar epic item

See merge request gitlab-org/gitlab!43867
parents 27c53c50 ced2486c
......@@ -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