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:
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