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 1
1
import chai from 'chai'
2
2
import chaiAsPromised from 'chai-as-promised'
3
3
import { MetadataBlockInfoJSDataverseRepository } from '../../../../src/metadata-block-info/infrastructure/repositories/MetadataBlockInfoJSDataverseRepository'
4
- import { MetadataBlockInfoCitationExample } from './MetadataBlockInfoCitationExample'
5
4
import { TestsUtils } from '../../shared/TestsUtils'
6
5
7
6
chai . use ( chaiAsPromised )
8
7
const expect = chai . expect
9
8
10
- const metadataBlockInfoExpected = MetadataBlockInfoCitationExample
11
9
const metadataBlockInfoRepository = new MetadataBlockInfoJSDataverseRepository ( )
12
10
describe ( 'Metadata Block Info JSDataverse Repository' , ( ) => {
13
11
before ( ( ) => TestsUtils . setup ( ) )
14
12
beforeEach ( ( ) => TestsUtils . login ( ) )
15
13
16
- it ( 'gets the metadataBlockInfo by name ' , async ( ) => {
14
+ it ( 'returns JSON in the correct format ' , async ( ) => {
17
15
await metadataBlockInfoRepository . getByName ( 'citation' ) . then ( ( metadataBlockInfo ) => {
18
16
if ( ! metadataBlockInfo ) {
19
17
throw new Error ( 'Metadata Block Info not found' )
20
18
}
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
+ } )
22
25
} )
23
26
} )
24
27
} )
You can’t perform that action at this time.
0 commit comments