Skip to content

Commit

Permalink
feat: update test Jsdataverse dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShi-1 committed Mar 3, 2025
1 parent c7b80bd commit 4d4e52f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const jsDataset = {
},
termsOfUse: {
fileAccessRequest: true,
termsOfAccess: 'New terms',
termsOfAccess: { fileAccessRequest: true },
dataAccessPlace: 'New place',
originalArchive: 'New archive',
availabilityStatus: 'New status',
Expand Down Expand Up @@ -211,6 +211,7 @@ const expectedDataset = {
majorNumber: 0
},
someDatasetVersionHasBeenReleased: false,
termsOfAccess: undefined,
citation:
'Finch, Fiona, 2023, "Darwin\'s Finches", <a href="https://doi.org/10.5072/FK2/B4B2MJ" target="_blank">https://doi.org/10.5072/FK2/B4B2MJ</a>, Root, DRAFT VERSION'
},
Expand Down Expand Up @@ -238,7 +239,7 @@ const expectedDataset = {
},
termsOfUse: {
fileAccessRequest: true,
termsOfAccess: 'New terms',
termsOfAccess: { fileAccessRequest: true },
dataAccessPlace: 'New place',
originalArchive: 'New archive',
availabilityStatus: 'New status',
Expand Down Expand Up @@ -314,6 +315,7 @@ const expectedDatasetWithPublicationDate = {
publishingStatus: 'draft',
isLatest: true,
isInReview: false,
termsOfAccess: undefined,
latestVersionPublishingStatus: 'draft',
number: {
minorNumber: 0,
Expand Down Expand Up @@ -347,7 +349,7 @@ const expectedDatasetWithPublicationDate = {
},
termsOfUse: {
fileAccessRequest: true,
termsOfAccess: 'New terms',
termsOfAccess: { fileAccessRequest: true },
dataAccessPlace: 'New place',
originalArchive: 'New archive',
availabilityStatus: 'New status',
Expand Down Expand Up @@ -430,6 +432,7 @@ const expectedDatasetWithNextVersionNumbers = {
majorNumber: 0
},
someDatasetVersionHasBeenReleased: true,
termsOfAccess: undefined,
citation:
'Finch, Fiona, 2023, "Darwin\'s Finches", <a href="https://doi.org/10.5072/FK2/B4B2MJ" target="_blank">https://doi.org/10.5072/FK2/B4B2MJ</a>, Root, DRAFT VERSION'
},
Expand Down Expand Up @@ -457,7 +460,7 @@ const expectedDatasetWithNextVersionNumbers = {
},
termsOfUse: {
fileAccessRequest: true,
termsOfAccess: 'New terms',
termsOfAccess: { fileAccessRequest: true },
dataAccessPlace: 'New place',
originalArchive: 'New archive',
availabilityStatus: 'New status',
Expand Down Expand Up @@ -544,6 +547,7 @@ const expectedDatasetAlternateVersion = {
majorNumber: 0
},
someDatasetVersionHasBeenReleased: false,
termsOfAccess: undefined,
citation:
'Finch, Fiona, 2023, "Darwin\'s Finches", <a href="https://doi.org/10.5072/FK2/B4B2MJ" target="_blank">https://doi.org/10.5072/FK2/B4B2MJ</a>, Root, DRAFT VERSION'
},
Expand Down Expand Up @@ -590,7 +594,7 @@ const expectedDatasetAlternateVersion = {
},
termsOfUse: {
fileAccessRequest: true,
termsOfAccess: 'New terms',
termsOfAccess: { fileAccessRequest: true },
dataAccessPlace: 'New place',
originalArchive: 'New archive',
availabilityStatus: 'New status',
Expand Down Expand Up @@ -660,6 +664,9 @@ describe('JS Dataset Mapper', () => {
jsDatasetFilesTotalOriginalDownloadSize,
jsDatasetFilesTotalArchivalDownloadSize
)

console.log('mapped', mapped)
console.log('expectedDataset', expectedDataset)
expect(expectedDataset).to.deep.equal(mapped)
})
it('maps jsDataset model to the domain Dataset model for alternate version', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ const datasetData = (persistentId: string, versionId: number) => {
{ semanticMeaning: 'dataset', value: 'Draft' },
{ semanticMeaning: 'warning', value: 'Unpublished' }
],
someDatasetVersionHasBeenReleased: false
someDatasetVersionHasBeenReleased: false,
termsOfAccess: undefined
},
permissions: {
canDownloadFiles: true,
Expand Down

0 comments on commit 4d4e52f

Please sign in to comment.