@@ -11,6 +11,7 @@ import { ROOT_COLLECTION_ALIAS } from '../../../src/collections/domain/models/Co
1111
1212describe ( 'CollectionsRepository' , ( ) => {
1313 const testGetCollection : CollectionsRepository = new CollectionsRepository ( )
14+ let testCollectionId : number
1415
1516 beforeAll ( async ( ) => {
1617 ApiConfig . init (
@@ -19,7 +20,10 @@ describe('CollectionsRepository', () => {
1920 process . env . TEST_API_KEY
2021 )
2122 try {
22- await createCollectionViaApi ( TestConstants . TEST_CREATED_COLLECTION_ALIAS_2 )
23+ await createCollectionViaApi ( TestConstants . TEST_CREATED_COLLECTION_ALIAS_2 ) . then (
24+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25+ ( response : any ) => ( testCollectionId = response . data . data . id )
26+ )
2327 } catch ( error ) {
2428 throw new Error ( 'Tests beforeAll(): Error while creating test collection' )
2529 }
@@ -65,10 +69,9 @@ describe('CollectionsRepository', () => {
6569 } )
6670 } )
6771 describe ( 'by numeric id' , ( ) => {
68- // FIXME
69- test . skip ( 'should return collection when it exists filtering by id AS (id)' , async ( ) => {
70- const actual = await testGetCollection . getCollection ( 1 )
71- expect ( actual . id ) . toBe ( 1 )
72+ test ( 'should return collection when it exists filtering by id AS (id)' , async ( ) => {
73+ const actual = await testGetCollection . getCollection ( testCollectionId )
74+ expect ( actual . id ) . toBe ( testCollectionId )
7275 } )
7376
7477 test ( 'should return error when collection does not exist' , async ( ) => {
0 commit comments