Commit ddcc7fb0 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'sh-fix-blocked-issue-closure' into 'master'

Hide confirmation modal after closing a blocked issue

See merge request gitlab-org/gitlab!42068
parents 351d9b6f 6d781001
......@@ -397,7 +397,7 @@ export default {
:secondary-button-text="__('Cancel')"
variant="warning"
:dismissible="false"
@primaryAction="forceCloseIssue"
@primaryAction="toggleBlockedIssueWarning(false) && forceCloseIssue()"
@secondaryAction="toggleBlockedIssueWarning(false) && enableButton()"
>
<p>
......
---
title: Hide confirmation modal after closing a blocked issue
merge_request: 42068
author:
type: fixed
......@@ -94,6 +94,31 @@ RSpec.describe 'Related issues', :js do
expect(items[0].text).to eq(issue_b.title)
expect(find('.js-related-issues-header-issue-count')).to have_content('1')
end
it 'hides the modal when issue is closed' do
# Workaround for modal not showing when issue is first added
visit project_issue_path(project, issue_a)
wait_for_requests
within('.new-note') do
button = find(:button, 'Close issue')
scroll_to(button)
button.click
end
click_button 'Yes, close issue'
wait_for_requests
find(:button, 'Yes, close issue', visible: false)
status_box = first('.status-box', visible: :all)
scroll_to(status_box)
within(status_box) do
expect(page).to have_content 'Closed'
end
end
end
context 'when adding "relates_to", "blocks", and "is_blocked_by" issues' do
......
......@@ -119,6 +119,13 @@ describe('issue_comment_form component', () => {
const primaryButton = warning.find('.gl-alert-actions .gl-button');
expect(primaryButton.text()).toEqual('Yes, close issue');
primaryButton.trigger('click');
wrapper.vm.$nextTick(() => {
expect(warning.exists()).toBe(false);
done();
});
setTimeout(() => {
expect(wrapper.vm.closeIssue).toHaveBeenCalled();
......
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