Skip to content

Commit 4e1c1a0

Browse files
committed
fix: unit tests
1 parent e30ad18 commit 4e1c1a0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

test/unit/collections/CollectionsRepository.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ describe('CollectionsRepository', () => {
580580
}
581581
jest.spyOn(axios, 'get').mockResolvedValue(payload)
582582

583-
const actual = await sut.getCollectionsForLinking('collection', 99, 'abc')
583+
const actual = await sut.getCollectionsForLinking('collection', 99, 'abc', false)
584584
const expectedEndpoint = `${TestConstants.TEST_API_URL}/dataverses/99/dataverse/linkingDataverses`
585585
const expectedParams = new URLSearchParams({ searchTerm: 'abc' })
586586
const expectedConfig = {
@@ -604,7 +604,7 @@ describe('CollectionsRepository', () => {
604604
jest.spyOn(axios, 'get').mockResolvedValue(payload)
605605

606606
const pid = 'doi:10.5072/FK2/J8SJZB'
607-
const actual = await sut.getCollectionsForLinking('dataset', pid, '')
607+
const actual = await sut.getCollectionsForLinking('dataset', pid, '', false)
608608
const expectedEndpoint = `${TestConstants.TEST_API_URL}/dataverses/:persistentId/dataset/linkingDataverses`
609609
const expectedParams = new URLSearchParams({ persistentId: pid })
610610
const expectedConfig = {

test/unit/collections/GetCollectionsForLinking.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('GetCollectionsForLinking', () => {
1414

1515
const uc = new GetCollectionsForLinking(repo)
1616
await expect(uc.execute('collection', 123, 'foo')).resolves.toEqual(sample)
17-
expect(repo.getCollectionsForLinking).toHaveBeenCalledWith('collection', 123, 'foo')
17+
expect(repo.getCollectionsForLinking).toHaveBeenCalledWith('collection', 123, 'foo', false)
1818
})
1919

2020
test('should return error result on repository error', async () => {
@@ -23,6 +23,11 @@ describe('GetCollectionsForLinking', () => {
2323

2424
const uc = new GetCollectionsForLinking(repo)
2525
await expect(uc.execute('dataset', 'doi:10.123/ABC')).rejects.toThrow(ReadError)
26-
expect(repo.getCollectionsForLinking).toHaveBeenCalledWith('dataset', 'doi:10.123/ABC', '')
26+
expect(repo.getCollectionsForLinking).toHaveBeenCalledWith(
27+
'dataset',
28+
'doi:10.123/ABC',
29+
'',
30+
false
31+
)
2732
})
2833
})

0 commit comments

Comments
 (0)