Skip to content

Commit 24ae72a

Browse files
committed
add more tests of response data
1 parent edf0409 commit 24ae72a

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/collections/infra/repositories/transformers/collectionTransformers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const transformPublicationStatusResponseToLabels = (
216216
const labels: CollectionItemsFacetLabel[] = []
217217
labels.push({ name: 'Published', count: publicationStatusCounts.published_count })
218218
labels.push({ name: 'Unpublished', count: publicationStatusCounts.unpublished_count })
219-
labels.push({ name: 'Draft ', count: publicationStatusCounts.draft_count })
219+
labels.push({ name: 'Draft', count: publicationStatusCounts.draft_count })
220220
labels.push({ name: 'In Review', count: publicationStatusCounts.in_review_count })
221221
labels.push({ name: 'Deaccessioned', count: publicationStatusCounts.deaccessioned_count })
222222
return labels

test/functional/collections/GetMyDataCollectionItems.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,33 @@ describe('execute', () => {
106106
expect(actualCollectionPreview.alias).toBe(testCollectionAlias)
107107

108108
expect(actual.totalItemCount).toBe(1)
109+
expect(actual.publishingFacet).toEqual([
110+
{
111+
name: 'Published',
112+
count: 0
113+
},
114+
{
115+
name: 'Unpublished',
116+
count: 1
117+
},
118+
{
119+
name: 'Draft',
120+
count: 0
121+
},
122+
{
123+
name: 'In Review',
124+
count: 0
125+
},
126+
{
127+
name: 'Deaccessioned',
128+
count: 0
129+
}
130+
])
131+
expect(actual.countPerObjectType).toEqual({
132+
dataverses: 1,
133+
datasets: 0,
134+
files: 0
135+
})
109136
} catch (error) {
110137
console.log(error)
111138
throw new Error('Item subset should be retrieved')

0 commit comments

Comments
 (0)