Commit fc3d44d1 authored by Scott Stern's avatar Scott Stern Committed by Ezekiel Kigbo

Splits changed event with close and open in board_editable_item

parent ad7b1241
......@@ -36,7 +36,7 @@ export default {
}
this.edit = true;
this.$emit('changed', this.edit);
this.$emit('open');
window.addEventListener('click', this.collapseWhenOffClick);
},
collapse() {
......@@ -45,7 +45,7 @@ export default {
}
this.edit = false;
this.$emit('changed', this.edit);
this.$emit('close');
window.removeEventListener('click', this.collapseWhenOffClick);
},
},
......
......@@ -96,12 +96,22 @@ describe('boards sidebar remove issue', () => {
expect(findExpanded().isVisible()).toBe(false);
});
it('emits changed event', async () => {
it('emits close event', async () => {
document.body.click();
await wrapper.vm.$nextTick();
expect(wrapper.emitted().changed[1][0]).toBe(false);
expect(wrapper.emitted().close.length).toBe(1);
});
});
it('emits open when edit button is clicked and edit is initailized to false', async () => {
createComponent({ canUpdate: true });
findEditButton().vm.$emit('click');
await wrapper.vm.$nextTick();
expect(wrapper.emitted().open.length).toBe(1);
});
});
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