Commit f4ebe0e5 authored by Bryce Johnson's avatar Bryce Johnson

Only replace non-approval mr-widget-footer on getMergeStatus.

parent 80d3020c
......@@ -149,7 +149,7 @@ require('./smart_interval');
var $html = $(data);
this.updateMergeButton(this.status, this.hasCi, $html);
$('.mr-widget-body').replaceWith($html.find('.mr-widget-body'));
$('.mr-widget-footer').replaceWith($html.find('.mr-widget-footer'));
$('.mr-widget-footer:not(.mr-approvals-footer)').replaceWith($html.find('.mr-widget-footer:not(.mr-approvals-footer)'));
$('.approvals-components').replaceWith($html.find('.approvals-components'));
if (gl.compileApprovalsWidget) {
......
---
title: Only replace non-approval mr-widget-footer on getMergeStatus.
merge_request:
author:
require 'spec_helper'
feature 'Merge Request closing issues message', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:issue_1) { create(:issue, project: project)}
......@@ -78,4 +80,18 @@ feature 'Merge Request closing issues message', feature: true do
expect(page).to have_content("Accepting this merge request will close issue #{issue_1.to_reference}. Issue #{issue_2.to_reference} is mentioned but will not be closed.")
end
end
context 'approvals are enabled while closing issues', js: true do
before do
project.team << [user, :developer]
end
let(:project) { create(:project, :public, approvals_before_merge: 1) }
let(:merge_request_description) { "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" }
it 'displays closing issue message exactly one time' do
wait_for_ajax
expect(page).to have_content("Accepting this merge request will close issues #{issue_1.to_reference} and #{issue_2.to_reference}", count: 1)
end
end
end
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