Skip to content

Commit 68760c1

Browse files
committed
fix: remove unneeded test data
1 parent b42e2f3 commit 68760c1

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

test/testHelpers/collections/collectionHelper.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const createCollectionModel = (): Collection => {
1414
alias: COLLECTION_ALIAS_STR,
1515
name: COLLECTION_NAME_STR,
1616
affiliation: COLLECTION_AFFILIATION_STR,
17-
description: COLLECTION_DESCRIPTION_HTML,
17+
description: COLLECTION_DESCRIPTION_MARKDOWN,
1818
isPartOf: { type: DvObjectType.DATAVERSE, identifier: 'root', displayName: 'Root' }
1919
}
2020
return collectionModel
@@ -31,11 +31,3 @@ export const createCollectionPayload = (): CollectionPayload => {
3131
}
3232
return collectionPayload
3333
}
34-
export const transformedCollectionModel: CollectionPayload = {
35-
id: COLLECTION_ID,
36-
alias: COLLECTION_ALIAS_STR,
37-
name: COLLECTION_NAME_STR,
38-
affiliation: COLLECTION_AFFILIATION_STR,
39-
description: COLLECTION_DESCRIPTION_MARKDOWN,
40-
isPartOf: { type: DvObjectType.DATAVERSE, identifier: 'root', displayName: 'Root' }
41-
}

test/unit/collections/CollectionsRepository.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {
66
} from '../../../src/core/infra/repositories/ApiConfig'
77
import {
88
createCollectionModel,
9-
createCollectionPayload,
10-
transformedCollectionModel
9+
createCollectionPayload
1110
} from '../../testHelpers/collections/collectionHelper'
1211
import { TestConstants } from '../../testHelpers/TestConstants'
1312
import { ReadError } from '../../../src'
@@ -46,7 +45,7 @@ describe('CollectionsRepository', () => {
4645
const actual = await sut.getCollection(testCollectionModel.id)
4746

4847
expect(axios.get).toHaveBeenCalledWith(expectedApiEndpoint, expectedRequestConfigApiKey)
49-
expect(actual).toStrictEqual(transformedCollectionModel)
48+
expect(actual).toStrictEqual(createCollectionModel())
5049
})
5150

5251
test('should return error on repository read error', async () => {
@@ -69,7 +68,7 @@ describe('CollectionsRepository', () => {
6968
const actual = await sut.getCollection(testCollectionModel.alias)
7069

7170
expect(axios.get).toHaveBeenCalledWith(expectedApiEndpoint, expectedRequestConfigApiKey)
72-
expect(actual).toStrictEqual(transformedCollectionModel)
71+
expect(actual).toStrictEqual(createCollectionModel())
7372
})
7473

7574
test('should return error on repository read error', async () => {
@@ -92,7 +91,7 @@ describe('CollectionsRepository', () => {
9291
const actual = await sut.getCollection()
9392

9493
expect(axios.get).toHaveBeenCalledWith(expectedApiEndpoint, expectedRequestConfigApiKey)
95-
expect(actual).toStrictEqual(transformedCollectionModel)
94+
expect(actual).toStrictEqual(createCollectionModel())
9695
})
9796

9897
test('should return error on repository read error', async () => {

0 commit comments

Comments
 (0)