diff options
Diffstat (limited to 'spec/features/projects/issues/design_management/user_views_designs_spec.rb')
-rw-r--r-- | spec/features/projects/issues/design_management/user_views_designs_spec.rb | 79 |
1 files changed, 59 insertions, 20 deletions
diff --git a/spec/features/projects/issues/design_management/user_views_designs_spec.rb b/spec/features/projects/issues/design_management/user_views_designs_spec.rb index d371ae1aad7..772a9ffbe6f 100644 --- a/spec/features/projects/issues/design_management/user_views_designs_spec.rb +++ b/spec/features/projects/issues/design_management/user_views_designs_spec.rb @@ -9,39 +9,78 @@ RSpec.describe 'User views issue designs', :js do let_it_be(:issue) { create(:issue, project: project) } let_it_be(:design) { create(:design, :with_file, issue: issue) } - before do - enable_design_management - end - - context 'navigates from the issue view' do + context 'design_management_moved flag disabled' do before do - visit project_issue_path(project, issue) - click_link 'Designs' - wait_for_requests + enable_design_management + stub_feature_flags(design_management_moved: false) end - it 'fetches list of designs' do - expect(page).to have_selector('.js-design-list-item', count: 1) + context 'navigates from the issue view' do + before do + visit project_issue_path(project, issue) + click_link 'Designs' + wait_for_requests + end + + it 'fetches list of designs' do + expect(page).to have_selector('.js-design-list-item', count: 1) + end end - end - context 'navigates directly to the design collection view' do - before do - visit designs_project_issue_path(project, issue) + context 'navigates directly to the design collection view' do + before do + visit designs_project_issue_path(project, issue) + end + + it 'expands the sidebar' do + expect(page).to have_selector('.layout-page.right-sidebar-expanded') + end end - it 'expands the sidebar' do - expect(page).to have_selector('.layout-page.right-sidebar-expanded') + context 'navigates directly to the individual design view' do + before do + visit designs_project_issue_path(project, issue, vueroute: design.filename) + end + + it 'sees the design' do + expect(page).to have_selector('.js-design-detail') + end end end - context 'navigates directly to the individual design view' do + context 'design_management_moved flag enabled' do before do - visit designs_project_issue_path(project, issue, vueroute: design.filename) + enable_design_management end - it 'sees the design' do - expect(page).to have_selector('.js-design-detail') + context 'navigates from the issue view' do + before do + visit project_issue_path(project, issue) + end + + it 'fetches list of designs' do + expect(page).to have_selector('.js-design-list-item', count: 1) + end + end + + context 'navigates directly to the design collection view' do + before do + visit designs_project_issue_path(project, issue) + end + + it 'expands the sidebar' do + expect(page).to have_selector('.layout-page.right-sidebar-expanded') + end + end + + context 'navigates directly to the individual design view' do + before do + visit designs_project_issue_path(project, issue, vueroute: design.filename) + end + + it 'sees the design' do + expect(page).to have_selector('.js-design-detail') + end end end end |