Skip to content

Commit 99a04c2

Browse files
authored
Merge pull request #502 from IQSS/fix/501-update-e2e-test
Fix/501 update e2e test
2 parents 453cfa3 + 7edf304 commit 99a04c2

File tree

2 files changed

+7
-88
lines changed

2 files changed

+7
-88
lines changed

tests/e2e-integration/integration/metadata-block-info/MetadataBlockInfoCitationExample.ts

Lines changed: 0 additions & 84 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import chai from 'chai'
22
import chaiAsPromised from 'chai-as-promised'
33
import { MetadataBlockInfoJSDataverseRepository } from '../../../../src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository'
4-
import { MetadataBlockInfoCitationExample } from './MetadataBlockInfoCitationExample'
54
import { TestsUtils } from '../../shared/TestsUtils'
65

76
chai.use(chaiAsPromised)
87
const expect = chai.expect
98

10-
const metadataBlockInfoExpected = MetadataBlockInfoCitationExample
119
const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository()
1210
describe('Metadata Block Info JSDataverse Repository', () => {
1311
before(() => TestsUtils.setup())
1412
beforeEach(() => TestsUtils.login())
1513

16-
it('gets the metadataBlockInfo by name', async () => {
14+
it('returns JSON in the correct format', async () => {
1715
await metadataBlockInfoRepository.getByName('citation').then((metadataBlockInfo) => {
1816
if (!metadataBlockInfo) {
1917
throw new Error('Metadata Block Info not found')
2018
}
21-
expect(metadataBlockInfo).to.deep.equal(metadataBlockInfoExpected)
19+
expect(metadataBlockInfo['name']).to.equal('citation')
20+
expect(metadataBlockInfo['fields']).to.be.an('object')
21+
Object.keys(metadataBlockInfo['fields']).forEach((field) => {
22+
expect(metadataBlockInfo['fields'][field]).to.be.an('object')
23+
expect(metadataBlockInfo['fields'][field]['displayFormat']).to.be.a('string')
24+
})
2225
})
2326
})
2427
})

0 commit comments

Comments
 (0)