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:
Diffstat (limited to 'spec/frontend/notes/components/noteable_discussion_spec.js')
-rw-r--r--spec/frontend/notes/components/noteable_discussion_spec.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/frontend/notes/components/noteable_discussion_spec.js b/spec/frontend/notes/components/noteable_discussion_spec.js
index c46d3bbe5b2..ddfa77117ca 100644
--- a/spec/frontend/notes/components/noteable_discussion_spec.js
+++ b/spec/frontend/notes/components/noteable_discussion_spec.js
@@ -87,10 +87,27 @@ describe('noteable_discussion component', () => {
expect(noteFormProps.discussion).toBe(discussionMock);
expect(noteFormProps.line).toBe(null);
- expect(noteFormProps.saveButtonTitle).toBe('Comment');
expect(noteFormProps.autosaveKey).toBe(`Note/Issue/${discussionMock.id}/Reply`);
});
+ it.each`
+ noteType | isNoteInternal | saveButtonTitle
+ ${'public'} | ${false} | ${'Reply'}
+ ${'internal'} | ${true} | ${'Reply internally'}
+ `(
+ 'reply button on form should have title "$saveButtonTitle" when note is $noteType',
+ async ({ isNoteInternal, saveButtonTitle }) => {
+ wrapper.setProps({ discussion: { ...discussionMock, confidential: isNoteInternal } });
+ await nextTick();
+
+ const replyPlaceholder = wrapper.find(ReplyPlaceholder);
+ replyPlaceholder.vm.$emit('focus');
+ await nextTick();
+
+ expect(wrapper.find(NoteForm).props('saveButtonTitle')).toBe(saveButtonTitle);
+ },
+ );
+
it('should expand discussion', async () => {
const discussion = { ...discussionMock, expanded: false };