diff options
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/active_sessions_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/profiles/user_edit_profile_spec.rb | 21 | ||||
-rw-r--r-- | spec/features/profiles/user_visits_profile_spec.rb | 57 |
3 files changed, 12 insertions, 68 deletions
diff --git a/spec/features/profiles/active_sessions_spec.rb b/spec/features/profiles/active_sessions_spec.rb index 24c9225532b..d0819bb5363 100644 --- a/spec/features/profiles/active_sessions_spec.rb +++ b/spec/features/profiles/active_sessions_spec.rb @@ -59,7 +59,7 @@ RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do expect(page).to( have_selector('ul.list-group li.list-group-item', text: 'Signed in on', - count: 2)) + count: 2)) expect(page).to have_content( '127.0.0.1 ' \ diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 2f7b722f553..d887a367fcb 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -8,6 +8,7 @@ RSpec.describe 'User edit profile' do let(:user) { create(:user) } before do + stub_feature_flags(remove_user_attributes_projects: false) sign_in(user) visit(profile_path) end @@ -179,7 +180,7 @@ RSpec.describe 'User edit profile' do end it 'adds emoji to user status' do - emoji = 'biohazard' + emoji = 'basketball' select_emoji(emoji) submit_settings @@ -192,7 +193,7 @@ RSpec.describe 'User edit profile' do it 'adds message to user status' do message = 'I have something to say' - fill_in 'js-status-message-field', with: message + fill_in s_("SetStatusModal|What's your status?"), with: message submit_settings visit_user @@ -207,7 +208,7 @@ RSpec.describe 'User edit profile' do emoji = '8ball' message = 'Playing outside' select_emoji(emoji) - fill_in 'js-status-message-field', with: message + fill_in s_("SetStatusModal|What's your status?"), with: message submit_settings visit_user @@ -229,7 +230,7 @@ RSpec.describe 'User edit profile' do end visit(profile_path) - click_button 'js-clear-user-status-button' + click_button s_('SetStatusModal|Clear status') submit_settings visit_user @@ -239,9 +240,9 @@ RSpec.describe 'User edit profile' do it 'displays a default emoji if only message is entered' do message = 'a status without emoji' - fill_in 'js-status-message-field', with: message + fill_in s_("SetStatusModal|What's your status?"), with: message - within('.js-toggle-emoji-menu') do + within('.emoji-menu-toggle-button') do expect(page).to have_emoji('speech_balloon') end end @@ -405,7 +406,7 @@ RSpec.describe 'User edit profile' do it 'adds message to user status' do message = 'I have something to say' open_user_status_modal - find('.js-status-message-field').native.send_keys(message) + find_field(s_("SetStatusModal|What's your status?")).native.send_keys(message) set_user_status_in_modal visit_user @@ -421,7 +422,7 @@ RSpec.describe 'User edit profile' do message = 'Playing outside' open_user_status_modal select_emoji(emoji, true) - find('.js-status-message-field').native.send_keys(message) + find_field(s_("SetStatusModal|What's your status?")).native.send_keys(message) set_user_status_in_modal visit_user @@ -445,7 +446,7 @@ RSpec.describe 'User edit profile' do open_edit_status_modal - find('.js-clear-user-status-button').click + click_button s_('SetStatusModal|Clear status') set_user_status_in_modal visit_user @@ -490,7 +491,7 @@ RSpec.describe 'User edit profile' do it 'displays a default emoji if only message is entered' do message = 'a status without emoji' open_user_status_modal - find('.js-status-message-field').native.send_keys(message) + find_field(s_("SetStatusModal|What's your status?")).native.send_keys(message) expect(page).to have_emoji('speech_balloon') end 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 |