Skip to content

Commit

Permalink
merged develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 2, 2024
2 parents bff3a8d + 99a04c2 commit 172ab32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 88 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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')
})
})
})
})

0 comments on commit 172ab32

Please sign in to comment.