Commit ca2830f5 authored by Fatih Acet's avatar Fatih Acet Committed by Alejandro Rodríguez

Merge branch 'disable-calendar-deselection' into 'master'

Fix deselecting calendar days on contribution graph

## What does this MR do?
Fix deselecting calendar days on contribution graph

## Are there points in the code the reviewer needs to double check?
Shouldn't be

## Why was this MR needed?
In `master`, you can currently deselect a calendar day after selecting but you cannot reselect that day.

## Screenshots (if relevant)
Before:
![2016-10-25_10.42.20](/uploads/7d442c09cd15082cf69f673a544b56f9/2016-10-25_10.42.20.gif)

After:
![2016-10-25_10.40.35](/uploads/6123365f0ec63ee84658ee6057e7715c/2016-10-25_10.40.35.gif)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?
Closes #22381

See merge request !6453
parent 65b63d10
......@@ -206,6 +206,7 @@
}
});
} else {
this.currentSelectedDate = '';
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
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
......
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