Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
CollectionPayload
} from './CollectionPayload'
import { transformPayloadToOwnerNode } from '../../../../core/infra/repositories/transformers/dvObjectOwnerNodeTransformer'
import { transformHtmlToMarkdown } from '../../../../datasets/infra/repositories/transformers/datasetTransformers'
import { CollectionFacet } from '../../../domain/models/CollectionFacet'
import { CollectionFacetPayload } from './CollectionFacetPayload'
import {
Expand Down Expand Up @@ -53,9 +52,7 @@ const transformPayloadToCollection = (collectionPayload: CollectionPayload): Col
type: collectionPayload.dataverseType as CollectionType,
isMetadataBlockRoot: collectionPayload.isMetadataBlockRoot,
isFacetRoot: collectionPayload.isFacetRoot,
...(collectionPayload.description && {
description: transformHtmlToMarkdown(collectionPayload.description)
}),
description: collectionPayload.description,
Comment thread
g-saracca marked this conversation as resolved.
...(collectionPayload.isPartOf && {
isPartOf: transformPayloadToOwnerNode(collectionPayload.isPartOf)
}),
Expand Down
7 changes: 3 additions & 4 deletions test/testHelpers/collections/collectionHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const COLLECTION_ALIAS_STR = 'secondCollection'
const COLLECTION_NAME_STR = 'Laboratory Research'
const COLLECTION_AFFILIATION_STR = 'Laboratory Research Corporation'

const COLLECTION_DESCRIPTION_HTML = 'This is an <b>example</b> collection used for testing.'
const COLLECTION_DESCRIPTION_MARKDOWN = 'This is an **example** collection used for testing.'
const COLLECTION_DESCRIPTION = 'This is an <b>example</b> collection used for testing.'

const DATAVERSE_API_REQUEST_HEADERS = {
headers: { 'Content-Type': 'application/json', 'X-Dataverse-Key': process.env.TEST_API_KEY }
Expand All @@ -30,7 +29,7 @@ export const createCollectionModel = (): Collection => {
name: COLLECTION_NAME_STR,
isReleased: COLLECTION_IS_RELEASED,
affiliation: COLLECTION_AFFILIATION_STR,
description: COLLECTION_DESCRIPTION_MARKDOWN,
description: COLLECTION_DESCRIPTION,
isPartOf: { type: DvObjectType.DATAVERSE, identifier: 'root', displayName: 'Root' },
inputLevels: [
{
Expand Down Expand Up @@ -59,7 +58,7 @@ export const createCollectionPayload = (): CollectionPayload => {
name: COLLECTION_NAME_STR,
isReleased: COLLECTION_IS_RELEASED,
affiliation: COLLECTION_AFFILIATION_STR,
description: COLLECTION_DESCRIPTION_HTML,
description: COLLECTION_DESCRIPTION,
isPartOf: { type: DvObjectType.DATAVERSE, identifier: 'root', displayName: 'Root' },
inputLevels: [
{
Expand Down