From a9d91ed20743b61d9e0361d7d7568d0781251817 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 12 Oct 2018 09:36:42 +0100 Subject: Hide job sidebar on mobile This commit adds back `js-` classes needed to automatically collapse the sidebar on resize. --- spec/features/projects/jobs_spec.rb | 39 ++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'spec/features/projects/jobs_spec.rb') diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index d981a919fd8..6224cbffe9d 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -667,7 +667,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do context 'with erased job', :js do let(:job) { create(:ci_build, :erased, pipeline: pipeline) } - it'renders erased job warning' do + it 'renders erased job warning' do visit project_job_path(project, job) wait_for_requests @@ -676,6 +676,43 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do end end end + + context 'without erased job', :js do + let(:job) { create(:ci_build, pipeline: pipeline) } + + it 'does not render erased job warning' do + visit project_job_path(project, job) + wait_for_requests + + expect(page).not_to have_css('.js-job-erased-block') + end + end + + context 'on mobile', :js do + let(:job) { create(:ci_build, pipeline: pipeline) } + + it 'renders collpased sidebar' do + page.current_window.resize_to(600, 800) + + visit project_job_path(project, job) + wait_for_requests + + expect(page).to have_css('.js-build-sidebar.right-sidebar-collapsed', visible: false) + expect(page).not_to have_css('.js-build-sidebar.right-sidebar-expanded', visible: false) + end + end + + context 'on desktop', :js do + let(:job) { create(:ci_build, pipeline: pipeline) } + + it 'renders expanded sidebar' do + visit project_job_path(project, job) + wait_for_requests + + expect(page).to have_css('.js-build-sidebar.right-sidebar-expanded') + expect(page).not_to have_css('.js-build-sidebar.right-sidebar-collpased') + end + end end describe "POST /:project/jobs/:id/cancel", :js do -- cgit v1.2.1