diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-09-26 08:28:50 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-09-26 08:28:50 +0000 |
commit | f3901842493c58faba71ad0812bf3102790a1b9f (patch) | |
tree | f30d0f4c67e80ec8fd591fa43b0b9b59998423c7 /spec/javascripts/diffs/components/commit_widget_spec.js | |
parent | c7fcb01b8adf988e2e10e63979507d99bedba163 (diff) | |
download | gitlab-ce-f3901842493c58faba71ad0812bf3102790a1b9f.tar.gz |
Resolve "Commit details are not displayed when reviewing an MR commit by commit"
Diffstat (limited to 'spec/javascripts/diffs/components/commit_widget_spec.js')
-rw-r--r-- | spec/javascripts/diffs/components/commit_widget_spec.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/javascripts/diffs/components/commit_widget_spec.js b/spec/javascripts/diffs/components/commit_widget_spec.js new file mode 100644 index 00000000000..951eb57255d --- /dev/null +++ b/spec/javascripts/diffs/components/commit_widget_spec.js @@ -0,0 +1,24 @@ +import Vue from 'vue'; +import mountComponent from 'spec/helpers/vue_mount_component_helper'; +import CommitWidget from '~/diffs/components/commit_widget.vue'; +import getDiffWithCommit from '../mock_data/diff_with_commit'; + +describe('diffs/components/commit_widget', () => { + const Component = Vue.extend(CommitWidget); + const { commit } = getDiffWithCommit(); + + let vm; + + beforeEach(() => { + vm = mountComponent(Component, { + commit: getDiffWithCommit().commit, + }); + }); + + it('renders commit item', () => { + const commitElement = vm.$el.querySelector('li.commit'); + + expect(commitElement).not.toBeNull(); + expect(commitElement).toContainText(commit.shortId); + }); +}); |