Commit 775c9f68 authored by Phil Hughes's avatar Phil Hughes

fixed specs when merged event was empty

parent e178eb78
...@@ -117,11 +117,9 @@ export default class MergeRequestStore { ...@@ -117,11 +117,9 @@ export default class MergeRequestStore {
} }
static getEventObject(event) { static getEventObject(event) {
if (!event) return null;
return { return {
author: MergeRequestStore.getAuthorObject(event), author: MergeRequestStore.getAuthorObject(event),
updatedAt: gl.utils.formatDate(event.updated_at), updatedAt: gl.utils.formatDate(MergeRequestStore.getEventUpdatedAtDate(event)),
formattedUpdatedAt: MergeRequestStore.getEventDate(event), formattedUpdatedAt: MergeRequestStore.getEventDate(event),
}; };
} }
...@@ -139,6 +137,14 @@ export default class MergeRequestStore { ...@@ -139,6 +137,14 @@ export default class MergeRequestStore {
}; };
} }
static getEventUpdatedAtDate(event) {
if (!event) {
return '';
}
return event.updated_at;
}
static getEventDate(event) { static getEventDate(event) {
const timeagoInstance = new Timeago(); const timeagoInstance = new Timeago();
...@@ -146,7 +152,7 @@ export default class MergeRequestStore { ...@@ -146,7 +152,7 @@ export default class MergeRequestStore {
return ''; return '';
} }
return timeagoInstance.format(event.updated_at); return timeagoInstance.format(MergeRequestStore.getEventUpdatedAtDate(event));
} }
} }
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