summaryrefslogtreecommitdiff
path: root/spec/frontend/releases/util_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/releases/util_spec.js')
-rw-r--r--spec/frontend/releases/util_spec.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/frontend/releases/util_spec.js b/spec/frontend/releases/util_spec.js
index e7b7766c0d0..fd00a524628 100644
--- a/spec/frontend/releases/util_spec.js
+++ b/spec/frontend/releases/util_spec.js
@@ -22,7 +22,7 @@ describe('releases/util.js', () => {
tagName: 'tag-name',
name: 'Release name',
description: 'Release description',
- milestones: [{ id: 1, title: '13.2' }, { id: 2, title: '13.3' }],
+ milestones: ['13.2', '13.3'],
assets: {
links: [{ url: 'https://gitlab.example.com/link', linkType: 'other' }],
},
@@ -74,14 +74,14 @@ describe('releases/util.js', () => {
});
});
- describe('when release.milestones is falsy', () => {
- it('includes a "milestone" property in the returned result as an empty array', () => {
- const release = {};
-
- const expectedJson = {
- milestones: [],
+ describe('when milestones contains full milestone objects', () => {
+ it('converts the milestone objects into titles', () => {
+ const release = {
+ milestones: [{ title: '13.2' }, { title: '13.3' }, '13.4'],
};
+ const expectedJson = { milestones: ['13.2', '13.3', '13.4'] };
+
expect(releaseToApiJson(release)).toMatchObject(expectedJson);
});
});