summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArinde Eniola <eniolaarinde1@gmail.com>2016-04-17 23:36:37 +0100
committerArinde Eniola <eniolaarinde1@gmail.com>2016-04-17 23:36:37 +0100
commita972a9d6b558d26d80f4970aefee88238d6a9473 (patch)
tree5c450d25e381a5a68f08fcf69f185ff7cc706749
parent8f1cb43fd60df8ed6d1e16232fcc46a09705bbee (diff)
downloadgitlab-ce-abstract_sidebar_logic.tar.gz
-rw-r--r--spec/features/issuable_sidebar_spec.rb117
1 files changed, 117 insertions, 0 deletions
diff --git a/spec/features/issuable_sidebar_spec.rb b/spec/features/issuable_sidebar_spec.rb
new file mode 100644
index 00000000000..52d06f1ca1d
--- /dev/null
+++ b/spec/features/issuable_sidebar_spec.rb
@@ -0,0 +1,117 @@
+require 'spec_helper'
+
+feature 'Issuable sidebar', feature: true do
+ include SortingHelper
+
+ let(:project) { create(:project) }
+ let!(:user) { create(:user)}
+ let(:merge_request) { create(:merge_request, :with_diffs, source_project: project) }
+
+ before do
+ project.team << [user, :master]
+
+ login_as user
+
+ visit namespace_project_merge_request_path(project.namespace, project, merge_request)
+ end
+
+ context 'changing tabs', js: true do
+
+ context 'between commits and changes for md' do
+
+ before do
+ page.driver.browser.resize(1024, 600)
+ end
+
+ it 'should show the right sidebar on commits tab' do
+ page.find('.commits-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+
+ it 'should collapse the right sidebar on changes tab' do
+ page.find('.diffs-tab').click
+
+ expect(page).to have_selector('.right-sidebar-collapsed')
+ end
+ end
+
+ context 'between discussion and changes for md' do
+
+ before do
+ page.driver.browser.resize(1024, 600)
+ end
+
+ it 'should show the right sidebar on discussion tab' do
+ page.find('.notes-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+
+ it 'should collapse the right sidebar on commits tab' do
+ page.find('.diffs-tab').click
+
+ expect(page).to have_selector('.right-sidebar-collapsed')
+ end
+ end
+
+ context 'when user collapse right sidebar for md' do
+
+ before do
+ page.driver.browser.resize(1024, 600)
+
+ page.find('.js-sidebar-toggle').click
+ end
+
+ it 'should not show the right sidebar on commits tab' do
+ page.find('.notes-tab').click
+
+ expect(page).to have_selector('.right-sidebar-collapsed')
+ end
+
+ it 'should not show the right sidebar on changes tab' do
+ page.find('.diffs-tab').click
+
+ expect(page).to have_selector('.right-sidebar-collapsed')
+ end
+ end
+
+ context 'between commits and changes for lg' do
+
+ before do
+ page.driver.browser.resize(1440, 600)
+ end
+
+ it 'should show the right sidebar on commits tab' do
+ page.find('.commits-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+
+ it 'should not collapse the right sidebar on changes tab' do
+ page.find('.diffs-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+ end
+
+ context 'between discussion and changes for lg' do
+
+ before do
+ page.driver.browser.resize(1440, 600)
+ end
+
+ it 'should show the right sidebar on discussion tab' do
+ page.find('.notes-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+
+ it 'should not collapse the right sidebar on commits tab' do
+ page.find('.diffs-tab').click
+
+ expect(page).to have_selector('.right-sidebar-expanded')
+ end
+ end
+ end
+end