Skip to content

Commit

Permalink
feat(DeaccessionedFiles): implement integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
MellyGray committed Oct 4, 2023
1 parent 15e1ffb commit 35ac5c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/files/infrastructure/mappers/JSFileMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export class JSFileMapper {
): FileVersion {
const fileVersion = { number: jsVersion, publishingStatus: FilePublishingStatus.DRAFT }

if (datasetVersion.publishingStatus === DatasetPublishingStatus.DEACCESSIONED) {
fileVersion.publishingStatus = FilePublishingStatus.DEACCESSIONED
}

if (jsPublicationDate) {
fileVersion.publishingStatus = FilePublishingStatus.RELEASED
}

if (datasetVersion.publishingStatus === DatasetPublishingStatus.DEACCESSIONED) {
fileVersion.publishingStatus = FilePublishingStatus.DEACCESSIONED
}

return fileVersion
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('File JSDataverse Repository', () => {
})
})

it.skip('gets all the files by dataset persistentId after dataset deaccession', async () => {
it.only('gets all the files by dataset persistentId after dataset deaccession', async () => {
const dataset = await DatasetHelper.createWithFiles(FileHelper.createMany(3)).then(
(datasetResponse) => datasetRepository.getByPersistentId(datasetResponse.persistentId)
)
Expand All @@ -170,7 +170,6 @@ describe('File JSDataverse Repository', () => {
await TestsUtils.wait(1500) // Wait for the dataset to be deaccessioned
await TestsUtils.wait(1500) // Wait for the dataset to be deaccessioned

// TODO - It always returns 404 when the dataset is deaccessioned, update the test when the issue is fixed
await fileRepository
.getAllByDatasetPersistentId(
dataset.persistentId,
Expand Down

0 comments on commit 35ac5c4

Please sign in to comment.