Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-01-17 22:38:10 +00:00
parent 3e420afdff
commit ad3bb109f8
3 changed files with 23 additions and 2 deletions

View File

@ -180,7 +180,7 @@ export default {
});
},
showLockIssueOption() {
return this.issueType === TYPE_ISSUE && this.isUserSignedIn;
return this.issueType === TYPE_ISSUE && this.isUserSignedIn && this.canUpdateIssue;
},
showMovedSidebarOptions() {
return this.isUserSignedIn;

View File

@ -160,7 +160,7 @@ module QA
"FEATURE_FLAGS" => env["QA_FEATURE_FLAGS"],
# QA_SUITES is only used by test-on-omnibus due to pipeline being reusable in external projects
"QA_SUITES" => executable_qa_suites,
"QA_TESTS" => tests.join(" ")
"QA_TESTS" => tests&.join(" ")
}.filter_map { |k, v| " #{k}: \"#{v}\"" unless v.blank? }.join("\n")
"#{variables}#{vars}"

View File

@ -139,6 +139,7 @@ describe('HeaderActions component', () => {
const findCopyRefenceDropdownItem = () => wrapper.findByTestId('copy-reference');
const findCopyEmailItem = () => wrapper.findByTestId('copy-email');
const findPromoteToEpicButton = () => wrapper.findByTestId('promote-button');
const findLockIssueToggle = () => wrapper.findByTestId('lock-issue-toggle');
const findModal = () => wrapper.findComponent(GlModal);
@ -344,6 +345,26 @@ describe('HeaderActions component', () => {
});
});
describe('Locking discussion', () => {
it.each`
description | canUpdateIssue | issueType | isLoggedIn | isExpected
${'shows lock issue toggle when type is issue, user is signed in, and canUpdateIssue is true'} | ${true} | ${TYPE_ISSUE} | ${true} | ${true}
${'does not show lock issue toggle if canUpdateIssue is false'} | ${false} | ${TYPE_ISSUE} | ${true} | ${false}
${'does not show lock issue toggle if type is not issue'} | ${true} | ${TYPE_INCIDENT} | ${true} | ${false}
${'does not show lock issue toggle if user is not signed in'} | ${true} | ${TYPE_ISSUE} | ${false} | ${false}
`('$description', ({ canUpdateIssue, issueType, isLoggedIn, isExpected }) => {
wrapper = mountComponent({
isLoggedIn,
props: {
canUpdateIssue,
issueType,
},
});
expect(findLockIssueToggle().exists()).toBe(isExpected);
});
});
describe('delete issue button', () => {
let trackingSpy;