diff --git a/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoCitationExample.ts b/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoCitationExample.ts deleted file mode 100644 index 4b7f621c9..000000000 --- a/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoCitationExample.ts +++ /dev/null @@ -1,84 +0,0 @@ -export const MetadataBlockInfoCitationExample = { - name: 'citation', - fields: { - title: { displayFormat: '' }, - subtitle: { displayFormat: '' }, - alternativeTitle: { displayFormat: '' }, - alternativeURL: { displayFormat: '[#VALUE](#VALUE)' }, - otherId: { displayFormat: ':' }, - otherIdAgency: { displayFormat: '#VALUE' }, - otherIdValue: { displayFormat: '#VALUE' }, - author: { displayFormat: '' }, - authorName: { displayFormat: '#VALUE' }, - authorAffiliation: { displayFormat: '(#VALUE)' }, - authorIdentifierScheme: { displayFormat: '- #VALUE:' }, - authorIdentifier: { displayFormat: '#VALUE' }, - datasetContact: { displayFormat: '' }, - datasetContactName: { displayFormat: '#VALUE' }, - datasetContactAffiliation: { displayFormat: '(#VALUE)' }, - datasetContactEmail: { displayFormat: '[#VALUE](mailto:#VALUE)' }, - dsDescription: { displayFormat: '' }, - dsDescriptionValue: { displayFormat: '#VALUE' }, - dsDescriptionDate: { displayFormat: '(#VALUE)' }, - subject: { displayFormat: '' }, - keyword: { displayFormat: '' }, - keywordValue: { displayFormat: '#VALUE' }, - keywordVocabulary: { displayFormat: '(#VALUE)' }, - keywordVocabularyURI: { displayFormat: '[#VALUE](#VALUE)' }, - keywordTermURI: { displayFormat: '[#VALUE](#VALUE)' }, - topicClassification: { displayFormat: '' }, - topicClassValue: { displayFormat: '#VALUE' }, - topicClassVocab: { displayFormat: '(#VALUE)' }, - topicClassVocabURI: { displayFormat: '[#VALUE](#VALUE)' }, - publication: { displayFormat: '' }, - publicationCitation: { displayFormat: '#VALUE' }, - publicationIDType: { displayFormat: '#VALUE: ' }, - publicationIDNumber: { displayFormat: '#VALUE' }, - publicationURL: { displayFormat: '[#VALUE](#VALUE)' }, - notesText: { displayFormat: '' }, - language: { displayFormat: '' }, - producer: { displayFormat: '' }, - producerName: { displayFormat: '#VALUE' }, - producerAffiliation: { displayFormat: '(#VALUE)' }, - producerAbbreviation: { displayFormat: '(#VALUE)' }, - producerURL: { displayFormat: '[#VALUE](#VALUE)' }, - producerLogoURL: { displayFormat: '![#NAME](#VALUE)' }, - productionDate: { displayFormat: '' }, - productionPlace: { displayFormat: '' }, - contributor: { displayFormat: ':' }, - contributorType: { displayFormat: '#VALUE ' }, - contributorName: { displayFormat: '#VALUE' }, - grantNumber: { displayFormat: ':' }, - grantNumberAgency: { displayFormat: '#VALUE' }, - grantNumberValue: { displayFormat: '#VALUE' }, - distributor: { displayFormat: '' }, - distributorName: { displayFormat: '#VALUE' }, - distributorAffiliation: { displayFormat: '(#VALUE)' }, - distributorAbbreviation: { displayFormat: '(#VALUE)' }, - distributorURL: { displayFormat: '[#VALUE](#VALUE)' }, - distributorLogoURL: { displayFormat: '![#NAME](#VALUE)' }, - distributionDate: { displayFormat: '' }, - depositor: { displayFormat: '' }, - dateOfDeposit: { displayFormat: '' }, - timePeriodCovered: { displayFormat: ';' }, - timePeriodCoveredStart: { displayFormat: '#NAME: #VALUE ' }, - timePeriodCoveredEnd: { displayFormat: '#NAME: #VALUE ' }, - dateOfCollection: { displayFormat: ';' }, - dateOfCollectionStart: { displayFormat: '#NAME: #VALUE ' }, - dateOfCollectionEnd: { displayFormat: '#NAME: #VALUE ' }, - kindOfData: { displayFormat: '' }, - series: { displayFormat: ':' }, - seriesName: { displayFormat: '#VALUE' }, - seriesInformation: { displayFormat: '#VALUE' }, - software: { displayFormat: ',' }, - softwareName: { displayFormat: '#VALUE' }, - softwareVersion: { displayFormat: '#NAME: #VALUE' }, - relatedMaterial: { displayFormat: '' }, - relatedDatasets: { displayFormat: '' }, - otherReferences: { displayFormat: '' }, - dataSources: { displayFormat: '' }, - originOfSources: { displayFormat: '' }, - characteristicOfSources: { displayFormat: '' }, - accessToSources: { displayFormat: '' } - } -} diff --git a/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoJSDataverseRepository.spec.ts b/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoJSDataverseRepository.spec.ts index 22b9543f6..7fcc2184b 100644 --- a/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoJSDataverseRepository.spec.ts +++ b/tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoJSDataverseRepository.spec.ts @@ -1,24 +1,27 @@ import chai from 'chai' import chaiAsPromised from 'chai-as-promised' import { MetadataBlockInfoJSDataverseRepository } from '../../../../src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository' -import { MetadataBlockInfoCitationExample } from './MetadataBlockInfoCitationExample' import { TestsUtils } from '../../shared/TestsUtils' chai.use(chaiAsPromised) const expect = chai.expect -const metadataBlockInfoExpected = MetadataBlockInfoCitationExample const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository() describe('Metadata Block Info JSDataverse Repository', () => { before(() => TestsUtils.setup()) beforeEach(() => TestsUtils.login()) - it('gets the metadataBlockInfo by name', async () => { + it('returns JSON in the correct format', async () => { await metadataBlockInfoRepository.getByName('citation').then((metadataBlockInfo) => { if (!metadataBlockInfo) { throw new Error('Metadata Block Info not found') } - expect(metadataBlockInfo).to.deep.equal(metadataBlockInfoExpected) + expect(metadataBlockInfo['name']).to.equal('citation') + expect(metadataBlockInfo['fields']).to.be.an('object') + Object.keys(metadataBlockInfo['fields']).forEach((field) => { + expect(metadataBlockInfo['fields'][field]).to.be.an('object') + expect(metadataBlockInfo['fields'][field]['displayFormat']).to.be.a('string') + }) }) }) })