Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-12 15:09:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-12 15:09:35 +0300
commita99c04f0185d6a6b398c37630c392ca84494c0a5 (patch)
treeb5b98085e799c85fff28193566019c6209019c5f /spec/frontend/notes/components
parent135059c00cbc56fd7b7fdc2a6a87c7a94fe64649 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/components')
-rw-r--r--spec/frontend/notes/components/comment_form_spec.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js
index 748cfdf0fb4..701ff492702 100644
--- a/spec/frontend/notes/components/comment_form_spec.js
+++ b/spec/frontend/notes/components/comment_form_spec.js
@@ -71,11 +71,19 @@ describe('issue_comment_form component', () => {
};
const notableDataMockCanUpdateIssuable = createNotableDataMock({
- current_user: { can_update: true, can_create_note: true },
+ current_user: { can_update: true, can_create_note: true, can_create_confidential_note: true },
});
const notableDataMockCannotUpdateIssuable = createNotableDataMock({
- current_user: { can_update: false, can_create_note: true },
+ current_user: {
+ can_update: false,
+ can_create_note: false,
+ can_create_confidential_note: false,
+ },
+ });
+
+ const notableDataMockCannotCreateConfidentialNote = createNotableDataMock({
+ current_user: { can_update: false, can_create_note: true, can_create_confidential_note: false },
});
const mountComponent = ({
@@ -562,6 +570,17 @@ describe('issue_comment_form component', () => {
expect(checkbox.element.checked).toBe(false);
});
+ it('should not render checkbox if user is not at least a reporter', () => {
+ mountComponent({
+ mountFunction: mount,
+ initialData: { note: 'confidential note' },
+ noteableData: { ...notableDataMockCannotCreateConfidentialNote },
+ });
+
+ const checkbox = findConfidentialNoteCheckbox();
+ expect(checkbox.exists()).toBe(false);
+ });
+
it.each`
noteableType | rendered | message
${'Issue'} | ${true} | ${'render'}