Commit 2ad630fb authored by Clement Ho's avatar Clement Ho

Fix deselecting calendar days on contribution graph

parent 5368b9f2
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
} }
}); });
} else { } else {
this.currentSelectedDate = '';
return $('.user-calendar-activities').html(''); return $('.user-calendar-activities').html('');
} }
}; };
......
---
title: Fix deselecting calendar days on contribution graph
merge_request: 6453
author: ClemMakesApps
...@@ -52,6 +52,10 @@ feature 'Contributions Calendar', js: true, feature: true do ...@@ -52,6 +52,10 @@ feature 'Contributions Calendar', js: true, feature: true do
Event.create(push_params) Event.create(push_params)
end end
def get_first_cell_content
find('.user-calendar-activities').text
end
before do before do
login_as :user login_as :user
visit @user.username visit @user.username
...@@ -62,6 +66,43 @@ feature 'Contributions Calendar', js: true, feature: true do ...@@ -62,6 +66,43 @@ feature 'Contributions Calendar', js: true, feature: true do
expect(page).to have_css('.js-contrib-calendar') expect(page).to have_css('.js-contrib-calendar')
end end
describe 'select calendar day', js: true do
let(:cells) { page.all('.user-contrib-cell') }
let(:first_cell_content_before) { get_first_cell_content }
before do
cells[0].click
wait_for_ajax
first_cell_content_before
end
it 'displays calendar day activities', js: true do
expect(get_first_cell_content).not_to eq('')
end
describe 'select another calendar day', js: true do
before do
cells[1].click
wait_for_ajax
end
it 'displays different calendar day activities', js: true do
expect(get_first_cell_content).not_to eq(first_cell_content_before)
end
end
describe 'deselect calendar day', js: true do
before do
cells[0].click
wait_for_ajax
end
it 'hides calendar day activities', js: true do
expect(get_first_cell_content).to eq('')
end
end
end
describe '1 calendar activity' do describe '1 calendar activity' do
before do before do
Issues::CreateService.new(contributed_project, @user, issue_params).execute Issues::CreateService.new(contributed_project, @user, issue_params).execute
......
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