diff options
Diffstat (limited to 'spec/features/profiles/user_visits_profile_spec.rb')
-rw-r--r-- | spec/features/profiles/user_visits_profile_spec.rb | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/spec/features/profiles/user_visits_profile_spec.rb b/spec/features/profiles/user_visits_profile_spec.rb index 7dd2e6aafa3..df096c2f151 100644 --- a/spec/features/profiles/user_visits_profile_spec.rb +++ b/spec/features/profiles/user_visits_profile_spec.rb @@ -87,61 +87,4 @@ RSpec.describe 'User visits their profile' do end end end - - describe 'storage_enforcement_banner', :js do - before do - stub_feature_flags(namespace_storage_limit_bypass_date_check: false) - end - - context 'with storage_enforcement_date set' do - let_it_be(:storage_enforcement_date) { Date.today + 30 } - - before do - allow_next_found_instance_of(Namespaces::UserNamespace) do |user_namespace| - allow(user_namespace).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) - end - end - - it 'displays the banner in the profile page' do - visit(profile_path) - expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - end - - it 'does not display the banner if user has previously closed unless threshold has changed' do - visit(profile_path) - expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - find('.js-storage-enforcement-banner [data-testid="close-icon"]').click - page.refresh - expect_page_not_to_have_storage_enforcement_banner - - storage_enforcement_date = Date.today + 13 - allow_next_found_instance_of(Namespaces::UserNamespace) do |user_namespace| - allow(user_namespace).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(Namespaces::UserNamespace) do |user_namespace| - allow(user_namespace).to receive(:storage_enforcement_date).and_return(nil) - end - end - - it 'does not display the banner in the group page' do - visit(profile_path) - 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 |