Skip to content

Commit

Permalink
test: update tests in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Nov 11, 2024
1 parent cfd2e80 commit 3ab4295
Show file tree
Hide file tree
Showing 6 changed files with 1,119 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { CollectionInputLevel } from '../../../../src/collection/domain/models/Collection'
import { CollectionInputLevelDTO } from '../../../../src/collection/domain/useCases/DTOs/CollectionDTO'
import { CollectionInputLevel } from '@/collection/domain/models/Collection'
import { CollectionContact } from '@/collection/domain/models/CollectionContact'
import { CollectionInputLevelDTO } from '@/collection/domain/useCases/DTOs/CollectionDTO'
import {
MetadataBlockInfo,
MetadataBlockName,
MetadataField
} from '../../../../src/metadata-block-info/domain/models/MetadataBlockInfo'
} from '@/metadata-block-info/domain/models/MetadataBlockInfo'
import { CollectionFormHelper } from '@/sections/shared/form/EditCreateCollectionForm/CollectionFormHelper'
import {
CollectionFormContactValue,
FormattedCollectionInputLevels,
FormattedCollectionInputLevelsWithoutParentBlockName,
MetadataFieldWithParentBlockInfo
} from '../../../../src/sections/create-collection/collection-form/CollectionForm'
import { CollectionFormHelper } from '../../../../src/sections/create-collection/collection-form/CollectionFormHelper'
} from '@/sections/shared/form/EditCreateCollectionForm/types'

const allMetadataBlocksInfoMock: MetadataBlockInfo[] = [
{
Expand Down Expand Up @@ -551,4 +553,29 @@ describe('CollectionFormHelper', () => {

expect(result).to.equal('coverage.Spectral.MinimumWavelength')
})

it('formats collection contacts to form contacts values', () => {
const collectionContacts: CollectionContact[] = [
{
email: '[email protected]',
displayOrder: 0
},
{
email: '[email protected]',
displayOrder: 1
}
]
const expected: CollectionFormContactValue[] = [
{
value: '[email protected]'
},
{
value: '[email protected]'
}
]

const result = CollectionFormHelper.formatCollectionContactsToFormContacts(collectionContacts)

expect(result).to.deep.equal(expected)
})
})
Loading

0 comments on commit 3ab4295

Please sign in to comment.