Skip to content

Commit 815f20f

Browse files
committed
Changed: enabled skipped test in CollectionsRepository
1 parent 1dfb1fa commit 815f20f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

test/integration/collections/CollectionsRepository.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ROOT_COLLECTION_ALIAS } from '../../../src/collections/domain/models/Co
1111

1212
describe('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 () => {

test/testHelpers/collections/test-collection-1.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": 100,
32
"alias": "testCollection1",
43
"name": "Scientific Research",
54
"dataverseContacts": [

test/testHelpers/collections/test-collection-2.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": 101,
32
"alias": "testCollection2",
43
"name": "Scientific Research",
54
"dataverseContacts": [

0 commit comments

Comments
 (0)