-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update facet query option size to be 10 (#40)
* fix: Update facet query option size to be 10 * chore: version upgrade and tests
- Loading branch information
1 parent
59607c8
commit 30dd5d2
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {Utility} from "../../search/utility"; | ||
import {FacetQueryFieldType} from "../../search/types"; | ||
|
||
describe('Search utility', () => { | ||
it('generates default facet query options', () => { | ||
const generatedOptions = Utility.createFacetQueryOptions(); | ||
expect(generatedOptions.size).toBe(10); | ||
expect(generatedOptions.type).toBe(FacetQueryFieldType.VALUE); | ||
}); | ||
|
||
it('backfills missing facet query options', () =>{ | ||
const generatedOptions = Utility.createFacetQueryOptions({ | ||
size: 55 | ||
}); | ||
expect(generatedOptions.size).toBe(55); | ||
expect(generatedOptions.type).toBe(FacetQueryFieldType.VALUE); | ||
}); | ||
|
||
it('generates default search request options', () => { | ||
const generatedOptions = Utility.createSearchRequestOptions(); | ||
expect(generatedOptions.page).toBe(1); | ||
expect(generatedOptions.perPage).toBe(10); | ||
}); | ||
|
||
it('backfills missing search request options', () => { | ||
const generatedOptions = Utility.createSearchRequestOptions({ | ||
perPage: 129 | ||
}); | ||
expect(generatedOptions.page).toBe(1); | ||
expect(generatedOptions.perPage).toBe(129); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters