diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 01:44:18 -0500 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 13:18:20 -0500 |
commit | 5a286eb7a3a0c395d35c722ce6a067aca47473f2 (patch) | |
tree | 1eb9364a353cf0dca945e073f7b7f74b246307f2 /spec/javascripts/diffs/components/commit_item_spec.js | |
parent | c375171bfd4b25d8cf4d7a95e2c65c655c7d647c (diff) | |
download | gitlab-ce-5a286eb7a3a0c395d35c722ce6a067aca47473f2.tar.gz |
Add signature badge to diffs/commit_item
**Notes:**
- Also exposes commit.signature_html in diffs.json
Diffstat (limited to 'spec/javascripts/diffs/components/commit_item_spec.js')
-rw-r--r-- | spec/javascripts/diffs/components/commit_item_spec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/javascripts/diffs/components/commit_item_spec.js b/spec/javascripts/diffs/components/commit_item_spec.js index 627fb8c490a..50651d67172 100644 --- a/spec/javascripts/diffs/components/commit_item_spec.js +++ b/spec/javascripts/diffs/components/commit_item_spec.js @@ -9,6 +9,7 @@ import getDiffWithCommit from '../mock_data/diff_with_commit'; const TEST_AUTHOR_NAME = 'test'; const TEST_AUTHOR_EMAIL = 'test+test@gitlab.com'; const TEST_AUTHOR_GRAVATAR = `${TEST_HOST}/avatar/test?s=36`; +const TEST_SIGNATURE_HTML = '<a>Legit commit</a>'; const getTitleElement = vm => vm.$el.querySelector('.commit-row-message.item-title'); const getDescElement = vm => vm.$el.querySelector('pre.commit-row-description'); @@ -16,6 +17,7 @@ const getDescExpandElement = vm => vm.$el.querySelector('.commit-content .text-e const getShaElement = vm => vm.$el.querySelector('.commit-sha-group'); const getAvatarElement = vm => vm.$el.querySelector('.user-avatar-link'); const getCommitterElement = vm => vm.$el.querySelector('.commiter'); +const getCommitActionsElement = vm => vm.$el.querySelector('.commit-actions'); describe('diffs/components/commit_widget', () => { const Component = Vue.extend(CommitItem); @@ -125,4 +127,20 @@ describe('diffs/components/commit_widget', () => { expect(nameElement).toHaveText(TEST_AUTHOR_NAME); }); }); + + describe('with signature', () => { + beforeEach(done => { + vm.commit.signatureHtml = TEST_SIGNATURE_HTML; + + vm.$nextTick() + .then(done) + .catch(done.fail); + }); + + it('renders signature html', () => { + const actionsElement = getCommitActionsElement(vm); + + expect(actionsElement).toContainHtml(TEST_SIGNATURE_HTML); + }); + }); }); |