Commit f83927eb authored by Filipa Lacerda's avatar Filipa Lacerda

Change prop name to keep consistency with other props.

parent 21d88cda
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* name * name
* ref_url * ref_url
*/ */
commitRef: { commit_ref: {
type: Object, type: Object,
required: false, required: false,
default: () => ({}), default: () => ({}),
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
* @returns {Boolean} * @returns {Boolean}
*/ */
hasCommitRef() { 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 @@ ...@@ -138,8 +138,8 @@
<a v-if="hasCommitRef" <a v-if="hasCommitRef"
class="monospace branch-name" class="monospace branch-name"
:href="commitRef.ref_url"> :href="commit_ref.ref_url">
{{commitRef.name}} {{commit_ref.name}}
</a> </a>
<div class="icon-container commit-icon commit-icon-container"></div> <div class="icon-container commit-icon commit-icon-container"></div>
......
...@@ -10,7 +10,7 @@ describe('Commit component', () => { ...@@ -10,7 +10,7 @@ describe('Commit component', () => {
el: document.querySelector('.test-commit-container'), el: document.querySelector('.test-commit-container'),
propsData: { propsData: {
tag: false, tag: false,
commitRef: { commit_ref: {
name: 'master', name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master', ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
}, },
...@@ -34,7 +34,7 @@ describe('Commit component', () => { ...@@ -34,7 +34,7 @@ describe('Commit component', () => {
props = { props = {
tag: true, tag: true,
commitRef: { commit_ref: {
name: 'master', name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master', ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
}, },
...@@ -59,11 +59,11 @@ describe('Commit component', () => { ...@@ -59,11 +59,11 @@ describe('Commit component', () => {
}); });
it('should render a link to the ref url', () => { 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', () => { 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', () => { it('should render the commit short sha with a link to the commit url', () => {
...@@ -103,7 +103,7 @@ describe('Commit component', () => { ...@@ -103,7 +103,7 @@ describe('Commit component', () => {
fixture.set('<div class="test-commit-container"></div>'); fixture.set('<div class="test-commit-container"></div>');
props = { props = {
tag: false, tag: false,
commitRef: { commit_ref: {
name: 'master', name: 'master',
ref_url: 'http://localhost/namespace2/gitlabhq/tree/master', ref_url: 'http://localhost/namespace2/gitlabhq/tree/master',
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment