summaryrefslogtreecommitdiff
path: root/spec/features/groups_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/features/groups_spec.rb
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
downloadgitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r--spec/features/groups_spec.rb71
1 files changed, 0 insertions, 71 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb
index c93ed01b873..4e02f6f7ca2 100644
--- a/spec/features/groups_spec.rb
+++ b/spec/features/groups_spec.rb
@@ -517,75 +517,4 @@ RSpec.describe 'Group' do
fill_in 'confirm_name_input', with: confirm_with
click_button 'Confirm'
end
-
- describe 'storage_enforcement_banner', :js do
- let_it_be(:group) { create(:group) }
- let_it_be_with_refind(:user) { create(:user) }
-
- before do
- group.add_owner(user)
- sign_in(user)
- end
-
- context 'with storage_enforcement_date set' do
- let_it_be(:storage_enforcement_date) { Date.today + 30 }
-
- before do
- allow_next_found_instance_of(Group) do |group|
- allow(group).to receive(:storage_enforcement_date).and_return(storage_enforcement_date)
- end
- end
-
- it 'displays the banner in the group page' do
- visit group_path(group)
- expect_page_to_have_storage_enforcement_banner(storage_enforcement_date)
- end
-
- it 'does not display the banner in a paid group page' do
- allow_next_found_instance_of(Group) do |group|
- allow(group).to receive(:paid?).and_return(true)
- end
- visit group_path(group)
- expect_page_not_to_have_storage_enforcement_banner
- end
-
- it 'does not display the banner if user has previously closed unless threshold has changed' do
- visit group_path(group)
- expect_page_to_have_storage_enforcement_banner(storage_enforcement_date)
- find('.js-storage-enforcement-banner [data-testid="close-icon"]').click
- wait_for_requests
- page.refresh
- expect_page_not_to_have_storage_enforcement_banner
-
- storage_enforcement_date = Date.today + 13
- allow_next_found_instance_of(Group) do |group|
- allow(group).to receive(:storage_enforcement_date).and_return(storage_enforcement_date)
- end
- page.refresh
- expect_page_to_have_storage_enforcement_banner(storage_enforcement_date)
- end
- end
-
- context 'with storage_enforcement_date not set' do
- before do
- allow_next_found_instance_of(Group) do |group|
- allow(group).to receive(:storage_enforcement_date).and_return(nil)
- end
- end
-
- it 'does not display the banner in the group page' do
- stub_feature_flags(namespace_storage_limit_bypass_date_check: false)
- visit group_path(group)
- expect_page_not_to_have_storage_enforcement_banner
- end
- end
- end
-
- def expect_page_to_have_storage_enforcement_banner(storage_enforcement_date)
- expect(page).to have_text "Effective #{storage_enforcement_date}, namespace storage limits will apply"
- end
-
- def expect_page_not_to_have_storage_enforcement_banner
- expect(page).not_to have_text "namespace storage limits will apply"
- end
end