diff options
author | Jose Ivan Vargas Lopez <jvargas@gitlab.com> | 2016-11-14 21:56:52 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-01-25 20:53:43 +0300 |
commit | ae65272bbf6f66162730f373bfa0236c67276c11 (patch) | |
tree | c4c82a377ae9c488e4dab39ad64b66c8f166a116 /spec/features/issues/issue_sidebar_spec.rb | |
parent | b55c1bc4b5fb8d259ba9f264eff607f81012fa39 (diff) |
Fixed Issuable sidebar so it remains closed on mobile/smaller screen devices
Added test to replicate the bug, also added a couple of helpers that can be reused
on the testing suite to resize the browser window, these helpers are located on the
spec/support/mobile_helpers.rb
Diffstat (limited to 'spec/features/issues/issue_sidebar_spec.rb')
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index bc068b5e7e0..64f7835eecd 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Issue Sidebar', feature: true do - include WaitForAjax + include WaitForAjax, MobileHelpers let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } @@ -59,6 +59,30 @@ feature 'Issue Sidebar', feature: true do end end + context 'sidebar', js: true do + it 'changes size when the screen size is smaller' do + sidebar_selector = 'aside.right-sidebar.right-sidebar-collapsed' + # Resize the window + resize_screen_sm + # Make sure the sidebar is collapsed + expect(page).to have_css(sidebar_selector) + # Once is collapsed let's open the sidebard and reload + page.within(sidebar_selector) do + find('.js-sidebar-toggle').click + # we wait a bit so the sidebar finishes it's animation + sleep 1 + end + refresh + expect(page).to have_css(sidebar_selector) + # Restore the window size as it was including the sidebar + restore_window_size + page.within(sidebar_selector) do + find('.js-sidebar-toggle').click + sleep 1 + end + end + end + context 'creating a new label', js: true do it 'shows option to crate a new label is present' do page.within('.block.labels') do |