summaryrefslogtreecommitdiff
path: root/spec/frontend/notes/components/note_form_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/notes/components/note_form_spec.js')
-rw-r--r--spec/frontend/notes/components/note_form_spec.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/frontend/notes/components/note_form_spec.js b/spec/frontend/notes/components/note_form_spec.js
index b709141f4ac..252c24d1117 100644
--- a/spec/frontend/notes/components/note_form_spec.js
+++ b/spec/frontend/notes/components/note_form_spec.js
@@ -6,7 +6,7 @@ import { getDraft, updateDraft } from '~/lib/utils/autosave';
import NoteForm from '~/notes/components/note_form.vue';
import createStore from '~/notes/stores';
import MarkdownField from '~/vue_shared/components/markdown/field.vue';
-import { noteableDataMock, notesDataMock, discussionMock } from '../mock_data';
+import { noteableDataMock, notesDataMock, discussionMock, note } from '../mock_data';
jest.mock('~/lib/utils/autosave');
@@ -45,8 +45,6 @@ describe('issue_note_form component', () => {
noteBody: 'Magni suscipit eius consectetur enim et ex et commodi.',
noteId: '545',
};
-
- gon.features = { markdownContinueLists: true };
});
afterEach(() => {
@@ -116,6 +114,23 @@ describe('issue_note_form component', () => {
expect(textarea.attributes('data-supports-quick-actions')).toBe('true');
});
+ it.each`
+ confidential | placeholder
+ ${false} | ${'Write a comment or drag your files here…'}
+ ${true} | ${'Write an internal note or drag your files here…'}
+ `(
+ 'should set correct textarea placeholder text when discussion confidentiality is $confidential',
+ ({ confidential, placeholder }) => {
+ props.note = {
+ ...note,
+ confidential,
+ };
+ wrapper = createComponentWrapper();
+
+ expect(wrapper.find('textarea').attributes('placeholder')).toBe(placeholder);
+ },
+ );
+
it('should link to markdown docs', () => {
const { markdownDocsPath } = notesDataMock;
const markdownField = wrapper.find(MarkdownField);