diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-25 21:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-25 21:10:10 +0300 |
commit | a653b30df71fcbe5be7dd30f34622500e527b5ea (patch) | |
tree | 80ee090386c158b008a2e7c571653148c5b3d528 /spec/features | |
parent | 180e88bbfbdd93939ec2c37e457207f29fd6ccfd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/profiles/keys_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index b49d16603b2..f54ee96befa 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -15,6 +15,7 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do end it 'auto-populates the title', :js do + click_button('Add new key') fill_in('Key', with: attributes_for(:key).fetch(:key)) expect(page).to have_field("Title", with: "dummy@gitlab.com") @@ -23,6 +24,7 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do it 'saves the new key' do attrs = attributes_for(:key) + click_button('Add new key') fill_in('Key', with: attrs[:key]) fill_in('Title', with: attrs[:title]) click_button('Add key') @@ -35,6 +37,7 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do it 'shows a confirmable warning if the key begins with an algorithm name that is unsupported' do attrs = attributes_for(:key) + click_button('Add new key') fill_in('Key', with: 'unsupported-ssh-rsa key') fill_in('Title', with: attrs[:title]) click_button('Add key') @@ -60,6 +63,7 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do it 'shows a validation error' do attrs = attributes_for(:key) + click_button('Add new key') fill_in('Key', with: attrs[:key]) fill_in('Title', with: attrs[:title]) click_button('Add key') @@ -79,13 +83,16 @@ RSpec.describe 'Profile > SSH Keys', feature_category: :user_profile do def destroy_key(path, action, confirmation_button) visit path - page.click_button(action) + page.find("button[aria-label=\"#{action}\"]").click page.within('.modal') do page.click_button(confirmation_button) end - expect(page).to have_content('Your SSH keys (0)') + expect(page).to have_content('Your SSH keys') + page.within('.gl-new-card-count') do + expect(page).to have_content('0') + end end describe 'User removes a key', :js do |