Commit 8ec2aa87 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '10777-fix-epic-sidebar-datepicker' into 'master'

Fix Epic sidebar datepicker

Closes #10777

See merge request gitlab-org/gitlab-ee!10496
parents b30c99e5 0a80f012
......@@ -171,8 +171,9 @@ export default {
this.editing = false;
this.$emit('toggleDateType', true, true);
},
toggleDatePicker() {
toggleDatePicker(e) {
this.editing = !this.editing;
e.stopPropagation();
},
newDateSelected(date = null) {
this.editing = false;
......
......@@ -121,6 +121,16 @@ describe 'Update Epic', :js do
end
end
context 'epic sidebar' do
it 'opens datepicker when clicking Edit button' do
page.within('.issuable-sidebar .block.start-date') do
click_button('Edit')
expect(find('.value-type-fixed')).to have_selector('.pikaday-container')
expect(find('.value-type-fixed')).to have_selector('.pikaday-container .pika-single.is-bound')
end
end
end
it 'updates the tasklist' do
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 1)
......
......@@ -169,10 +169,14 @@ describe('SidebarDatePicker', () => {
describe('toggleDatePicker', () => {
it('flips value of `editing` prop from `true` to `false` and vice-versa', () => {
const e = new Event('click');
spyOn(e, 'stopPropagation');
vm.editing = true;
vm.toggleDatePicker();
vm.toggleDatePicker(e);
expect(vm.editing).toBe(false);
expect(e.stopPropagation).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