Skip to content

Commit

Permalink
test: simplify set expected params
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Dec 9, 2024
1 parent 1c01762 commit f6c393a
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions test/unit/collections/CollectionsRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,11 @@ describe('CollectionsRepository', () => {
[GetCollectionItemsQueryParams.QUERY]: '*',
[GetCollectionItemsQueryParams.SHOW_FACETS]: 'true',
[GetCollectionItemsQueryParams.SORT]: SortType.DATE,
[GetCollectionItemsQueryParams.ORDER]: OrderType.DESC
[GetCollectionItemsQueryParams.ORDER]: OrderType.DESC,
[GetCollectionItemsQueryParams.PER_PAGE]: testLimit.toString(),
[GetCollectionItemsQueryParams.START]: testOffset.toString()
})

expectedRequestParamsWithPagination.set(
GetCollectionItemsQueryParams.PER_PAGE,
testLimit.toString()
)
expectedRequestParamsWithPagination.set(
GetCollectionItemsQueryParams.START,
testOffset.toString()
)

const expectedRequestConfigApiKeyWithPagination = {
params: expectedRequestParamsWithPagination,
headers: TestConstants.TEST_EXPECTED_AUTHENTICATED_REQUEST_CONFIG_API_KEY.headers
Expand Down Expand Up @@ -503,14 +496,10 @@ describe('CollectionsRepository', () => {
[GetCollectionItemsQueryParams.QUERY]: '*',
[GetCollectionItemsQueryParams.SHOW_FACETS]: 'true',
[GetCollectionItemsQueryParams.SORT]: SortType.DATE,
[GetCollectionItemsQueryParams.ORDER]: OrderType.DESC
[GetCollectionItemsQueryParams.ORDER]: OrderType.DESC,
[GetCollectionItemsQueryParams.SUBTREE]: testCollectionId
})

expectedRequestParamsWithCollectionId.set(
GetCollectionItemsQueryParams.SUBTREE,
testCollectionId
)

const expectedRequestConfigApiKeyWithCollectionId = {
params: expectedRequestParamsWithCollectionId,
headers: TestConstants.TEST_EXPECTED_AUTHENTICATED_REQUEST_CONFIG_API_KEY.headers
Expand Down

0 comments on commit f6c393a

Please sign in to comment.