Commit e839f486 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'fix-signature-badge-popover' into 'master'

Fix signature badge popover not showing on Firefox

See merge request gitlab-org/gitlab!24756
parents a8f201f0 73634a9c
......@@ -30,5 +30,5 @@
= link_to(_('Learn more about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gpg-popover-help-link')
%button{ tabindex: 0, class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } }
%a{ role: 'button', tabindex: 0, class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } }
= label
---
title: Fix signature badge popover on Firefox
merge_request: 24756
author:
type: fixed
......@@ -15,8 +15,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, ref)
expect(page).to have_button 'Unverified'
expect(page).not_to have_button 'Verified'
expect(page).to have_selector('.gpg-status-box', text: 'Unverified')
# user changes their email which makes the gpg key verified
perform_enqueued_jobs do
......@@ -26,8 +25,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, ref)
expect(page).not_to have_button 'Unverified'
expect(page).to have_button 'Verified'
expect(page).to have_selector('.gpg-status-box', text: 'Verified')
end
it 'changes from unverified to verified when the user adds the missing gpg key', :sidekiq_might_not_need_inline do
......@@ -36,8 +34,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, ref)
expect(page).to have_button 'Unverified'
expect(page).not_to have_button 'Verified'
expect(page).to have_selector('.gpg-status-box', text: 'Unverified')
# user adds the gpg key which makes the signature valid
perform_enqueued_jobs do
......@@ -46,8 +43,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, ref)
expect(page).not_to have_button 'Unverified'
expect(page).to have_button 'Verified'
expect(page).to have_selector('.gpg-status-box', text: 'Verified')
end
context 'shows popover badges', :js do
......@@ -77,7 +73,7 @@ describe 'GPG signed commits' do
it 'unverified signature' do
visit project_commit_path(project, GpgHelpers::SIGNED_COMMIT_SHA)
click_on 'Unverified'
page.find('.gpg-status-box', text: 'Unverified').click
within '.popover' do
expect(page).to have_content 'This commit was signed with an unverified signature.'
......@@ -90,7 +86,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, GpgHelpers::DIFFERING_EMAIL_SHA)
click_on 'Unverified'
page.find('.gpg-status-box', text: 'Unverified').click
within '.popover' do
expect(page).to have_content 'This commit was signed with a verified signature, but the committer email is not verified to belong to the same user.'
......@@ -105,7 +101,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, GpgHelpers::SIGNED_COMMIT_SHA)
click_on 'Unverified'
page.find('.gpg-status-box', text: 'Unverified').click
within '.popover' do
expect(page).to have_content "This commit was signed with a different user's verified signature."
......@@ -120,7 +116,7 @@ describe 'GPG signed commits' do
visit project_commit_path(project, GpgHelpers::SIGNED_AND_AUTHORED_SHA)
click_on 'Verified'
page.find('.gpg-status-box', text: 'Verified').click
within '.popover' do
expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
......@@ -136,13 +132,13 @@ describe 'GPG signed commits' do
visit project_commit_path(project, GpgHelpers::SIGNED_AND_AUTHORED_SHA)
# wait for the signature to get generated
expect(page).to have_button 'Verified'
expect(page).to have_selector('.gpg-status-box', text: 'Verified')
user_1.destroy!
refresh
click_on 'Verified'
page.find('.gpg-status-box', text: 'Verified').click
within '.popover' do
expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
......@@ -160,9 +156,9 @@ describe 'GPG signed commits' do
end
it 'displays commit signature' do
expect(page).to have_button 'Unverified'
expect(page).to have_selector('.gpg-status-box', text: 'Unverified')
click_on 'Unverified'
page.find('.gpg-status-box', text: 'Unverified').click
within '.popover' do
expect(page).to have_content 'This commit was signed with an unverified signature'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment