Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/features/projects/show
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/features/projects/show')
-rw-r--r--spec/features/projects/show/user_manages_notifications_spec.rb34
-rw-r--r--spec/features/projects/show/user_uploads_files_spec.rb20
2 files changed, 37 insertions, 17 deletions
diff --git a/spec/features/projects/show/user_manages_notifications_spec.rb b/spec/features/projects/show/user_manages_notifications_spec.rb
index 5f7d9b0963b..80dae4ec386 100644
--- a/spec/features/projects/show/user_manages_notifications_spec.rb
+++ b/spec/features/projects/show/user_manages_notifications_spec.rb
@@ -6,38 +6,36 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
let(:project) { create(:project, :public, :repository) }
before do
- stub_feature_flags(vue_notification_dropdown: false)
sign_in(project.owner)
end
def click_notifications_button
- first('.notifications-btn').click
+ first('[data-testid="notification-dropdown"]').click
end
it 'changes the notification setting' do
visit project_path(project)
click_notifications_button
- click_link 'On mention'
+ click_button 'On mention'
- page.within('.notification-dropdown') do
- expect(page).not_to have_css('.gl-spinner')
- end
+ wait_for_requests
click_notifications_button
- expect(find('.update-notification.is-active')).to have_content('On mention')
- expect(page).to have_css('.notifications-icon[data-testid="notifications-icon"]')
+
+ page.within first('[data-testid="notification-dropdown"]') do
+ expect(page.find('.gl-new-dropdown-item.is-active')).to have_content('On mention')
+ expect(page).to have_css('[data-testid="notifications-icon"]')
+ end
end
it 'changes the notification setting to disabled' do
visit project_path(project)
click_notifications_button
- click_link 'Disabled'
+ click_button 'Disabled'
- page.within('.notification-dropdown') do
- expect(page).not_to have_css('.gl-spinner')
+ page.within first('[data-testid="notification-dropdown"]') do
+ expect(page).to have_css('[data-testid="notifications-off-icon"]')
end
-
- expect(page).to have_css('.notifications-icon[data-testid="notifications-off-icon"]')
end
context 'custom notification settings' do
@@ -65,11 +63,13 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
it 'shows notification settings checkbox' do
visit project_path(project)
click_notifications_button
- page.find('a[data-notification-level="custom"]').click
+ click_button 'Custom'
+
+ wait_for_requests
- page.within('.custom-notifications-form') do
+ page.within('#custom-notifications-modal') do
email_events.each do |event_name|
- expect(page).to have_selector("input[name='notification_setting[#{event_name}]']")
+ expect(page).to have_selector("[data-testid='notification-setting-#{event_name}']")
end
end
end
@@ -80,7 +80,7 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
it 'is disabled' do
visit project_path(project)
- expect(page).to have_selector('.notifications-btn.disabled', visible: true)
+ expect(page).to have_selector('[data-testid="notification-dropdown"] .disabled', visible: true)
end
end
end
diff --git a/spec/features/projects/show/user_uploads_files_spec.rb b/spec/features/projects/show/user_uploads_files_spec.rb
index 053598a528e..2030c4d998a 100644
--- a/spec/features/projects/show/user_uploads_files_spec.rb
+++ b/spec/features/projects/show/user_uploads_files_spec.rb
@@ -33,4 +33,24 @@ RSpec.describe 'Projects > Show > User uploads files' do
include_examples 'it uploads and commit a new file to a forked project'
end
+
+ context 'when in the empty_repo_upload experiment' do
+ before do
+ stub_experiments(empty_repo_upload: :candidate)
+
+ visit(project_path(project))
+ end
+
+ context 'with an empty repo' do
+ let(:project) { create(:project, :empty_repo, creator: user) }
+
+ include_examples 'uploads and commits a new text file via "upload file" button'
+ end
+
+ context 'with a nonempty repo' do
+ let(:project) { create(:project, :repository, creator: user) }
+
+ include_examples 'uploads and commits a new text file via "upload file" button'
+ end
+ end
end