diff options
author | Michel Engelen <michel.engelen@diva-e.com> | 2019-06-14 11:28:16 +0200 |
---|---|---|
committer | Michel Engelen <michel@nomorejs.net> | 2019-07-02 14:29:54 +0200 |
commit | 2ded70292eee23fe2db89cc584ef5a2f8c42c6d8 (patch) | |
tree | 8dee9e13c6b8bd2aee3ba0d46a2a182dfbbc521c | |
parent | 4169421049e1909bddc49582f7ebd89bd504af00 (diff) | |
download | gitlab-ce-2ded70292eee23fe2db89cc584ef5a2f8c42c6d8.tar.gz |
prettified noteable_discussion component and updated tests
-rw-r--r-- | app/assets/javascripts/notes/components/noteable_discussion.vue | 4 | ||||
-rw-r--r-- | spec/javascripts/notes/components/noteable_discussion_spec.js | 36 |
2 files changed, 19 insertions, 21 deletions
diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index 13cc1ade7ae..0031056ad4f 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -176,9 +176,7 @@ export default { let text = s__('MergeRequests|started a thread'); if (isForCommit) { - text = s__( - 'MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}', - ); + text = s__('MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}'); } else if (isDiffDiscussion && commitId) { text = isActive ? s__('MergeRequests|started a thread on commit %{linkStart}%{commitId}%{linkEnd}') diff --git a/spec/javascripts/notes/components/noteable_discussion_spec.js b/spec/javascripts/notes/components/noteable_discussion_spec.js index efa864e7d00..48b33ce87af 100644 --- a/spec/javascripts/notes/components/noteable_discussion_spec.js +++ b/spec/javascripts/notes/components/noteable_discussion_spec.js @@ -39,11 +39,11 @@ describe('noteable_discussion component', () => { expect(wrapper.find('.user-avatar-link').exists()).toBe(true); }); - it('should not render discussion header for non diff discussions', () => { + it('should not render thread header for non diff threads', () => { expect(wrapper.find('.discussion-header').exists()).toBe(false); }); - it('should render discussion header', done => { + it('should render thread header', done => { const discussion = { ...discussionMock }; discussion.diff_file = mockDiffFile; discussion.diff_discussion = true; @@ -90,16 +90,16 @@ describe('noteable_discussion component', () => { .catch(done.fail); }); - it('does not render jump to discussion button', () => { + it('does not render jump to thread button', () => { expect( - wrapper.find('*[data-original-title="Jump to next unresolved discussion"]').exists(), + wrapper.find('*[data-original-title="Jump to next unresolved thread"]').exists(), ).toBe(false); }); }); describe('methods', () => { describe('jumpToNextDiscussion', () => { - it('expands next unresolved discussion', done => { + it('expands next unresolved thread', done => { const discussion2 = getJSONFixture(discussionWithTwoUnresolvedNotes)[0]; discussion2.resolved = false; discussion2.active = true; @@ -162,20 +162,20 @@ describe('noteable_discussion component', () => { .catch(done.fail); }); - describe('for commit discussions', () => { - it('should display a monospace started a discussion on commit', () => { - expect(wrapper.text()).toContain(`started a discussion on commit ${truncatedCommitId}`); + describe('for commit threads', () => { + it('should display a monospace started a thread on commit', () => { + expect(wrapper.text()).toContain(`started a thread on commit ${truncatedCommitId}`); expect(commitElement.exists()).toBe(true); expect(commitElement.text()).toContain(truncatedCommitId); }); }); - describe('for diff discussion with a commit id', () => { - it('should display started discussion on commit header', done => { + describe('for diff thread with a commit id', () => { + it('should display started thread on commit header', done => { wrapper.vm.discussion.for_commit = false; wrapper.vm.$nextTick(() => { - expect(wrapper.text()).toContain(`started a discussion on commit ${truncatedCommitId}`); + expect(wrapper.text()).toContain(`started a thread on commit ${truncatedCommitId}`); expect(commitElement).not.toBe(null); @@ -199,21 +199,21 @@ describe('noteable_discussion component', () => { }); }); - describe('for diff discussions without a commit id', () => { - it('should show started a discussion on the diff text', done => { + describe('for diff threads without a commit id', () => { + it('should show started a thread on the diff text', done => { Object.assign(wrapper.vm.discussion, { for_commit: false, commit_id: null, }); wrapper.vm.$nextTick(() => { - expect(wrapper.text()).toContain('started a discussion on the diff'); + expect(wrapper.text()).toContain('started a thread on the diff'); done(); }); }); - it('should show discussion on older version text', done => { + it('should show thread on older version text', done => { Object.assign(wrapper.vm.discussion, { for_commit: false, commit_id: null, @@ -221,7 +221,7 @@ describe('noteable_discussion component', () => { }); wrapper.vm.$nextTick(() => { - expect(wrapper.text()).toContain('started a discussion on an old version of the diff'); + expect(wrapper.text()).toContain('started a thread on an old version of the diff'); done(); }); @@ -229,7 +229,7 @@ describe('noteable_discussion component', () => { }); }); - describe('for resolved discussion', () => { + describe('for resolved thread', () => { beforeEach(() => { const discussion = getJSONFixture(discussionWithTwoUnresolvedNotes)[0]; wrapper.setProps({ discussion }); @@ -242,7 +242,7 @@ describe('noteable_discussion component', () => { }); }); - describe('for unresolved discussion', () => { + describe('for unresolved thread', () => { beforeEach(done => { const discussion = { ...getJSONFixture(discussionWithTwoUnresolvedNotes)[0], |