summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-12-02 15:41:58 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-02 15:41:58 +0000
commitf83927ebdeffb6529d864de51279509f18b99bc5 (patch)
treea4804a49e7cea9a8b2f102858b6ffccbfe1775fe
parent21d88cda23e415b5fde98a25956a0e1461f53409 (diff)
downloadgitlab-ce-25264-ref-commit.tar.gz
Change prop name to keep consistency with other props.25264-ref-commit
-rw-r--r--app/assets/javascripts/vue_common_component/commit.js.es68
-rw-r--r--spec/javascripts/vue_common_components/commit_spec.js.es610
2 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_common_component/commit.js.es6 b/app/assets/javascripts/vue_common_component/commit.js.es6
index 3ecb1efd2fc..2ef2959cbf4 100644
--- a/app/assets/javascripts/vue_common_component/commit.js.es6
+++ b/app/assets/javascripts/vue_common_component/commit.js.es6
@@ -23,7 +23,7 @@
* name
* ref_url
*/
- commitRef: {
+ commit_ref: {
type: Object,
required: false,
default: () => ({}),
@@ -80,7 +80,7 @@
* @returns {Boolean}
*/
hasCommitRef() {
- return this.commitRef && this.commitRef.name && this.commitRef.ref_url;
+ return this.commit_ref && this.commit_ref.name && this.commit_ref.ref_url;
},
/**
@@ -138,8 +138,8 @@
<a v-if="hasCommitRef"
class="monospace branch-name"
- :href="commitRef.ref_url">
- {{commitRef.name}}
+ :href="commit_ref.ref_url">
+ {{commit_ref.name}}
</a>
<div class="icon-container commit-icon commit-icon-container"></div>
diff --git a/spec/javascripts/vue_common_components/commit_spec.js.es6 b/spec/javascripts/vue_common_components/commit_spec.js.es6
index 8b32b2c5cf7..d170517dd9b 100644
--- a/spec/javascripts/vue_common_components/commit_spec.js.es6
+++ b/spec/javascripts/vue_common_components/commit_spec.js.es6
@@ -10,7 +10,7 @@ describe('Commit component', () => {
el: document.querySelector('.test-commit-container'),
propsData: {
tag: false,
- commitRef: {
+ commit_ref: {
name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
},
@@ -34,7 +34,7 @@ describe('Commit component', () => {
props = {
tag: true,
- commitRef: {
+ commit_ref: {
name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
},
@@ -59,11 +59,11 @@ describe('Commit component', () => {
});
it('should render a link to the ref url', () => {
- expect(component.$el.querySelector('.branch-name').getAttribute('href')).toEqual(props.commitRef.ref_url);
+ expect(component.$el.querySelector('.branch-name').getAttribute('href')).toEqual(props.commit_ref.ref_url);
});
it('should render the ref name', () => {
- expect(component.$el.querySelector('.branch-name').textContent).toContain(props.commitRef.name);
+ expect(component.$el.querySelector('.branch-name').textContent).toContain(props.commit_ref.name);
});
it('should render the commit short sha with a link to the commit url', () => {
@@ -103,7 +103,7 @@ describe('Commit component', () => {
fixture.set('<div class="test-commit-container"></div>');
props = {
tag: false,
- commitRef: {
+ commit_ref: {
name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
},