diff --git a/test/integration/collections/CollectionsRepository.test.ts b/test/integration/collections/CollectionsRepository.test.ts index 81140cbe..1265f17b 100644 --- a/test/integration/collections/CollectionsRepository.test.ts +++ b/test/integration/collections/CollectionsRepository.test.ts @@ -23,6 +23,7 @@ import { CollectionPayload } from '../../../src/collections/infra/repositories/t import { uploadFileViaApi } from '../../testHelpers/files/filesHelper' import { deleteUnpublishedDatasetViaApi } from '../../testHelpers/datasets/datasetHelper' import { PublicationStatus } from '../../../src/core/domain/models/PublicationStatus' +import { CollectionType } from '../../../src/collections/domain/models/CollectionType' describe('CollectionsRepository', () => { const testCollectionAlias = 'collectionsRepositoryTestCollection' @@ -61,6 +62,10 @@ describe('CollectionsRepository', () => { expect(actual.affiliation).toBe(undefined) expect(actual.description).toBe('The root dataverse.') expect(actual.inputLevels).toBe(undefined) + expect(actual.type).toBe(CollectionType.UNCATEGORIZED) + expect(actual.contacts).toEqual([{ email: 'root@mailinator.com', displayOrder: 0 }]) + expect(actual.usesMetadataFieldsFromParent).toBe(true) + expect(actual.usesBrowseSearchFacetsFromParent).toBe(true) }) test('should return isReleased is true for root collection', async () => { diff --git a/test/testHelpers/collections/collectionHelper.ts b/test/testHelpers/collections/collectionHelper.ts index c2ecccf3..67fa09ed 100644 --- a/test/testHelpers/collections/collectionHelper.ts +++ b/test/testHelpers/collections/collectionHelper.ts @@ -3,9 +3,10 @@ import { DvObjectType } from '../../../src' import { CollectionPayload } from '../../../src/collections/infra/repositories/transformers/CollectionPayload' import { TestConstants } from '../TestConstants' import axios from 'axios' -import { CollectionDTO, CollectionType } from '../../../src/collections/domain/dtos/CollectionDTO' +import { CollectionDTO } from '../../../src/collections/domain/dtos/CollectionDTO' import { NewCollectionRequestPayload } from '../../../src/collections/infra/repositories/CollectionsRepository' import { CollectionFacetPayload } from '../../../src/collections/infra/repositories/transformers/CollectionFacetPayload' +import { CollectionType } from '../../../src/collections/domain/models/CollectionType' const COLLECTION_ID = 11111 const COLLECTION_IS_RELEASED = true @@ -35,7 +36,16 @@ export const createCollectionModel = (): Collection => { required: true, include: true } - ] + ], + type: CollectionType.UNCATEGORIZED, + contacts: [ + { + email: 'dataverse@test.com', + displayOrder: 0 + } + ], + usesMetadataFieldsFromParent: true, + usesBrowseSearchFacetsFromParent: true } return collectionModel } @@ -55,7 +65,16 @@ export const createCollectionPayload = (): CollectionPayload => { required: true, include: true } - ] + ], + dataverseType: CollectionType.UNCATEGORIZED, + dataverseContacts: [ + { + contactEmail: 'dataverse@test.com', + displayOrder: 0 + } + ], + usesBrowseSearchFacetsFromParent: true, + usesMetadataFieldsFromParent: true } return collectionPayload }