Commit 34744afd authored by Phil Hughes's avatar Phil Hughes

Fixes merge request controls not being visible

This fixes a bug where viewing a commit in a single commit
merge request would throw a JavaScript error and not
display the merge request controls.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/326801
parent 4366b711
......@@ -142,7 +142,7 @@ export default {
</gl-button-group>
</div>
<gl-sprintf
v-else-if="hasSourceVersions"
v-else-if="!commit && hasSourceVersions"
class="d-flex align-items-center compare-versions-container"
:message="s__('MergeRequest|Compare %{target} and %{source}')"
>
......
---
title: Fixes merge request controls not visible when merge request has single commit
merge_request:
author:
type: fixed
......@@ -19,8 +19,11 @@ describe('CompareVersions', () => {
const targetBranchName = 'tmp-wine-dev';
const { commit } = getDiffWithCommit();
const createWrapper = (props = {}, commitArgs = {}) => {
const createWrapper = (props = {}, commitArgs = {}, createCommit = true) => {
if (createCommit) {
store.state.diffs.commit = { ...store.state.diffs.commit, ...commitArgs };
}
wrapper = mount(CompareVersionsComponent, {
localVue,
store,
......@@ -59,7 +62,7 @@ describe('CompareVersions', () => {
describe('template', () => {
beforeEach(() => {
createWrapper();
createWrapper({}, {}, false);
});
it('should render Tree List toggle button with correct attribute values', () => {
......
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