Fix commit SHA not showing in merge request compare dropdown

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17011
in GitLab 11.1 refactored the merge request diff comparison
functionality but omitted the commit SHA due to a change in
the API (truncated_commit_sha -> short_commit_sha).

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55822
This commit is contained in:
Stan Hu 2018-12-31 08:48:44 -08:00
parent 4d875a2bc3
commit ef304611ad
3 changed files with 17 additions and 1 deletions

View File

@ -129,7 +129,7 @@ export default {
</strong>
</div>
<div>
<small class="commit-sha"> {{ version.truncated_commit_sha }} </small>
<small class="commit-sha"> {{ version.short_commit_sha }} </small>
</div>
<div>
<small>

View File

@ -0,0 +1,5 @@
---
title: Fix commit SHA not showing in merge request compare dropdown
merge_request: 24084
author:
type: fixed

View File

@ -64,6 +64,17 @@ describe 'Merge request > User sees versions', :js do
end
end
it 'shows the commit SHAs for every version in the dropdown' do
page.within '.mr-version-dropdown' do
find('.btn-default').click
page.within('.dropdown-content') do
shas = merge_request.merge_request_diffs.map { |diff| Commit.truncate_sha(diff.head_commit_sha) }
shas.each { |sha| expect(page).to have_content(sha) }
end
end
end
it 'shows comments that were last relevant at that version' do
expect(page).to have_content '5 changed files'