File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { ApiConfig } from '../../../src'
33import { TestConstants } from '../../testHelpers/TestConstants'
44import { DataverseApiAuthMechanism } from '../../../src/core/infra/repositories/ApiConfig'
55import { FieldValidationError } from '../../../src/datasets/domain/useCases/validators/errors/FieldValidationError'
6+ import { deleteUnpublishedDatasetViaApi } from '../../testHelpers/datasets/datasetHelper'
67
78describe ( 'execute' , ( ) => {
89 beforeEach ( async ( ) => {
@@ -56,6 +57,7 @@ describe('execute', () => {
5657 expect ( createdDatasetIdentifiers ) . not . toBeNull ( )
5758 expect ( createdDatasetIdentifiers . numericId ) . not . toBeNull ( )
5859 expect ( createdDatasetIdentifiers . persistentId ) . not . toBeNull ( )
60+ await deleteUnpublishedDatasetViaApi ( createdDatasetIdentifiers . numericId )
5961 }
6062 } )
6163
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ import {
77} from '../../../src'
88import { TestConstants } from '../../testHelpers/TestConstants'
99import { DataverseApiAuthMechanism } from '../../../src/core/infra/repositories/ApiConfig'
10- import { waitForNoLocks } from '../../testHelpers/datasets/datasetHelper'
10+ import {
11+ waitForNoLocks ,
12+ deletePublishedDatasetViaApi
13+ } from '../../testHelpers/datasets/datasetHelper'
1114
1215const testNewDataset = {
1316 license : {
@@ -57,12 +60,16 @@ describe('execute', () => {
5760 } )
5861
5962 test ( 'should successfully publish a dataset' , async ( ) => {
60- const dataset = await createDataset . execute ( testNewDataset )
63+ const createdDatasetIdentifiers = await createDataset . execute ( testNewDataset )
6164
62- const response = await publishDataset . execute ( dataset . persistentId , VersionUpdateType . MAJOR )
63- await waitForNoLocks ( dataset . numericId , 10 )
65+ const response = await publishDataset . execute (
66+ createdDatasetIdentifiers . persistentId ,
67+ VersionUpdateType . MAJOR
68+ )
69+ await waitForNoLocks ( createdDatasetIdentifiers . numericId , 10 )
6470
6571 expect ( response ) . toBeUndefined ( )
72+ await deletePublishedDatasetViaApi ( createdDatasetIdentifiers . persistentId )
6673 } )
6774
6875 test ( 'should throw an error when trying to publish a dataset that does not exist' , async ( ) => {
You can’t perform that action at this time.
0 commit comments