Skip to content

feat: getfilterchips method added to sort options #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025

Conversation

roger-in-kiva
Copy link
Collaborator

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new getFilterChips helper to the sortOptions module to produce UI filter chips based on the selected sort option.

  • Implement getFilterChips in sortOptions.ts to return a chip object when sortBy is defined.
  • Extend mockAllFacets fixture with a sortOptions array to support the new method.
  • Add unit tests for the new getFilterChips behavior in sortOptions.spec.ts.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
@kiva/kv-loan-filters/src/sortOptions.ts Implement getFilterChips to map sortBy state to a chip object.
@kiva/kv-loan-filters/src/tests/fixtures/mockLoanSearchData.ts Add sortOptions fixture data so tests can find matching facets.
@kiva/kv-loan-filters/src/tests/sortOptions.spec.ts Add tests for getFilterChips handling undefined and valid inputs.
Comments suppressed due to low confidence (2)

@kiva/kv-loan-filters/src/tests/sortOptions.spec.ts:88

  • Introduce a test for an unknown sortBy value to verify that getFilterChips returns an empty array when no facet matches.
			it('should return chips', () => {

@kiva/kv-loan-filters/src/sortOptions.ts:94

  • [nitpick] Add a JSDoc comment to getFilterChips explaining its parameters (loanSearchState, facets) and the shape of the returned chip object for clarity.
	getFilterChips: (loanSearchState, facets) => {

@roger-in-kiva roger-in-kiva merged commit 8941a6f into main Jul 10, 2025
5 checks passed
@roger-in-kiva roger-in-kiva deleted the MP-1570_sortby_chips branch July 10, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants