Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-09-21 19:34:16 +0300
committerClement Ho <ClemMakesApps@gmail.com>2016-11-04 18:01:20 +0300
commit2ad630fb51da9eacfb8716a4615e250efd44e0a7 (patch)
tree9786a52818fc4469488798231fc1e1a1f0531c57 /spec/features/calendar_spec.rb
parent5368b9f249485e254a90fe7daa551d61412bee26 (diff)
Fix deselecting calendar days on contribution graph
Diffstat (limited to 'spec/features/calendar_spec.rb')
-rw-r--r--spec/features/calendar_spec.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/features/calendar_spec.rb b/spec/features/calendar_spec.rb
index 7fa0c95cae2..3e0b6364e0d 100644
--- a/spec/features/calendar_spec.rb
+++ b/spec/features/calendar_spec.rb
@@ -52,6 +52,10 @@ feature 'Contributions Calendar', js: true, feature: true do
Event.create(push_params)
end
+ def get_first_cell_content
+ find('.user-calendar-activities').text
+ end
+
before do
login_as :user
visit @user.username
@@ -62,6 +66,43 @@ feature 'Contributions Calendar', js: true, feature: true do
expect(page).to have_css('.js-contrib-calendar')
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
before do
Issues::CreateService.new(contributed_project, @user, issue_params).execute