summaryrefslogtreecommitdiff
path: root/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/issues/design_management/user_uploads_designs_spec.rb')
-rw-r--r--spec/features/projects/issues/design_management/user_uploads_designs_spec.rb62
1 files changed, 47 insertions, 15 deletions
diff --git a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
index 66b449a9de5..2381e00972f 100644
--- a/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
+++ b/spec/features/projects/issues/design_management/user_uploads_designs_spec.rb
@@ -13,10 +13,10 @@ RSpec.describe 'User uploads new design', :js do
sign_in(user)
end
- context "when the feature is available" do
+ context 'design_management_moved flag disabled' do
before do
- enable_design_management
-
+ enable_design_management(feature_enabled)
+ stub_feature_flags(design_management_moved: false)
visit project_issue_path(project, issue)
click_link 'Designs'
@@ -24,32 +24,64 @@ RSpec.describe 'User uploads new design', :js do
wait_for_requests
end
- it 'uploads designs' do
- attach_file(:design_file, logo_fixture, make_visible: true)
+ context "when the feature is available" do
+ let(:feature_enabled) { true }
+
+ it 'uploads designs' do
+ attach_file(:design_file, logo_fixture, make_visible: true)
+
+ expect(page).to have_selector('.js-design-list-item', count: 1)
+
+ within first('#designs-tab .js-design-list-item') do
+ expect(page).to have_content('dk.png')
+ end
- expect(page).to have_selector('.js-design-list-item', count: 1)
+ attach_file(:design_file, gif_fixture, make_visible: true)
- within first('#designs-tab .js-design-list-item') do
- expect(page).to have_content('dk.png')
+ expect(page).to have_selector('.js-design-list-item', count: 2)
end
+ end
- attach_file(:design_file, gif_fixture, make_visible: true)
+ context 'when the feature is not available' do
+ let(:feature_enabled) { false }
- expect(page).to have_selector('.js-design-list-item', count: 2)
+ it 'shows the message about requirements' do
+ expect(page).to have_content("To enable design management, you'll need to meet the requirements.")
+ end
end
end
- context 'when the feature is not available' do
+ context 'design_management_moved flag enabled' do
before do
+ enable_design_management(feature_enabled)
+ stub_feature_flags(design_management_moved: true)
visit project_issue_path(project, issue)
+ end
- click_link 'Designs'
+ context "when the feature is available" do
+ let(:feature_enabled) { true }
- wait_for_requests
+ it 'uploads designs', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/225616' do
+ attach_file(:design_file, logo_fixture, make_visible: true)
+
+ expect(page).to have_selector('.js-design-list-item', count: 1)
+
+ within first('[data-testid="designs-root"] .js-design-list-item') do
+ expect(page).to have_content('dk.png')
+ end
+
+ attach_file(:design_file, gif_fixture, make_visible: true)
+
+ expect(page).to have_selector('.js-design-list-item', count: 2)
+ end
end
- it 'shows the message about requirements' do
- expect(page).to have_content("To enable design management, you'll need to meet the requirements.")
+ context 'when the feature is not available' do
+ let(:feature_enabled) { false }
+
+ it 'shows the message about requirements' do
+ expect(page).to have_content("To enable design management, you'll need to meet the requirements.")
+ end
end
end