File tree Expand file tree Collapse file tree 2 files changed +7
-88
lines changed
tests/e2e-integration/integration/metadata-block-info Expand file tree Collapse file tree 2 files changed +7
-88
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import chai from 'chai'
22import chaiAsPromised from 'chai-as-promised'
33import { MetadataBlockInfoJSDataverseRepository } from '../../../../src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository'
4- import { MetadataBlockInfoCitationExample } from './MetadataBlockInfoCitationExample'
54import { TestsUtils } from '../../shared/TestsUtils'
65
76chai . use ( chaiAsPromised )
87const expect = chai . expect
98
10- const metadataBlockInfoExpected = MetadataBlockInfoCitationExample
119const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository ( )
1210describe ( '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} )
You can’t perform that action at this time.
0 commit comments