Skip to content

Commit

Permalink
GQL-85: Allow users to view collection
Browse files Browse the repository at this point in the history
  • Loading branch information
mandyparson committed Nov 14, 2024
1 parent 165e167 commit 9be4310
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cmr/concepts/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default class Collection extends Concept {
* @param {Object} item The item returned from the CMR umm endpoint
*/
normalizeUmmItem(item) {
const { umm } = item
const { umm = {} } = item

const { ArchiveAndDistributionInformation: archiveAndDistributionInformation = {} } = umm

Expand Down
20 changes: 16 additions & 4 deletions src/resolvers/__tests__/collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe('Collection', () => {

nock(/example-cmr/)
.defaultReplyHeaders({
'CMR-Hits': 2,
'CMR-Hits': 3,
'CMR-Took': 7,
'CMR-Request-Id': 'abcd-1234-efgh-5678'
})
Expand All @@ -277,7 +277,8 @@ describe('Collection', () => {
meta: {
'concept-id': 'C100000-EDSC',
'native-id': 'test-guid',
'revision-id': '2'
'revision-id': '3',
deleted: false
},
umm: {
Abstract: 'Cras mattis consectetur purus sit amet fermentum.'
Expand All @@ -286,7 +287,15 @@ describe('Collection', () => {
meta: {
'concept-id': 'C100000-EDSC',
'native-id': 'test-guid',
'revision-id': '1'
'revision-id': '2',
deleted: true
}
}, {
meta: {
'concept-id': 'C100000-EDSC',
'native-id': 'test-guid',
'revision-id': '1',
deleted: false
},
umm: {
Abstract: 'Cras mattis consectetur purus sit amet fermentum.'
Expand Down Expand Up @@ -549,8 +558,11 @@ describe('Collection', () => {
quality: 'Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.',
relatedUrls: [],
revisions: {
count: 2,
count: 3,
items: [
{
revisionId: '3'
},
{
revisionId: '2'
},
Expand Down

0 comments on commit 9be4310

Please sign in to comment.