This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(is-routing): support instantsearch routing (#551)
* feat(is-routing): support instantsearch routing makes Places InstantSearch Widget support the routing API from InstantSearch. * test(is-routing): add tests for the case where there is no widgetOptions * fix(is-routing): avoid overriding position in init * fix(is-routing): support backward and forward navigation
- Loading branch information
1 parent
449c84d
commit 05a8cdb
Showing
3 changed files
with
435 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`instantsearch widget routing getWidgetSearchParameters should add the refinements according to the UI state provided 1`] = ` | ||
SearchParameters { | ||
"advancedSyntax": undefined, | ||
"allowTyposOnNumericTokens": undefined, | ||
"analytics": undefined, | ||
"analyticsTags": undefined, | ||
"aroundLatLng": "123,123", | ||
"aroundLatLngViaIP": undefined, | ||
"aroundPrecision": undefined, | ||
"aroundRadius": undefined, | ||
"attributesToHighlight": undefined, | ||
"attributesToRetrieve": undefined, | ||
"attributesToSnippet": undefined, | ||
"disableExactOnAttributes": undefined, | ||
"disjunctiveFacets": Array [], | ||
"disjunctiveFacetsRefinements": Object {}, | ||
"distinct": undefined, | ||
"enableExactOnSingleWordQuery": undefined, | ||
"facets": Array [], | ||
"facetsExcludes": Object {}, | ||
"facetsRefinements": Object {}, | ||
"getRankingInfo": undefined, | ||
"hierarchicalFacets": Array [], | ||
"hierarchicalFacetsRefinements": Object {}, | ||
"highlightPostTag": undefined, | ||
"highlightPreTag": undefined, | ||
"hitsPerPage": undefined, | ||
"ignorePlurals": undefined, | ||
"index": "", | ||
"insideBoundingBox": undefined, | ||
"insidePolygon": undefined, | ||
"length": undefined, | ||
"maxValuesPerFacet": undefined, | ||
"minProximity": undefined, | ||
"minWordSizefor1Typo": undefined, | ||
"minWordSizefor2Typos": undefined, | ||
"minimumAroundRadius": undefined, | ||
"numericFilters": undefined, | ||
"numericRefinements": Object {}, | ||
"offset": undefined, | ||
"optionalFacetFilters": undefined, | ||
"optionalTagFilters": undefined, | ||
"optionalWords": undefined, | ||
"page": 0, | ||
"query": "", | ||
"queryType": undefined, | ||
"removeWordsIfNoResults": undefined, | ||
"replaceSynonymsInHighlight": undefined, | ||
"restrictSearchableAttributes": undefined, | ||
"snippetEllipsisText": undefined, | ||
"synonyms": undefined, | ||
"tagFilters": undefined, | ||
"tagRefinements": Array [], | ||
"typoTolerance": undefined, | ||
} | ||
`; | ||
|
||
exports[`instantsearch widget routing getWidgetSearchParameters should enforce the default value if no value is in the UI State 1`] = ` | ||
SearchParameters { | ||
"advancedSyntax": undefined, | ||
"allowTyposOnNumericTokens": undefined, | ||
"analytics": undefined, | ||
"analyticsTags": undefined, | ||
"aroundLatLng": "2,2", | ||
"aroundLatLngViaIP": undefined, | ||
"aroundPrecision": undefined, | ||
"aroundRadius": undefined, | ||
"attributesToHighlight": undefined, | ||
"attributesToRetrieve": undefined, | ||
"attributesToSnippet": undefined, | ||
"disableExactOnAttributes": undefined, | ||
"disjunctiveFacets": Array [], | ||
"disjunctiveFacetsRefinements": Object {}, | ||
"distinct": undefined, | ||
"enableExactOnSingleWordQuery": undefined, | ||
"facets": Array [], | ||
"facetsExcludes": Object {}, | ||
"facetsRefinements": Object {}, | ||
"getRankingInfo": undefined, | ||
"hierarchicalFacets": Array [], | ||
"hierarchicalFacetsRefinements": Object {}, | ||
"highlightPostTag": undefined, | ||
"highlightPreTag": undefined, | ||
"hitsPerPage": undefined, | ||
"ignorePlurals": undefined, | ||
"index": "", | ||
"insideBoundingBox": undefined, | ||
"insidePolygon": undefined, | ||
"length": undefined, | ||
"maxValuesPerFacet": undefined, | ||
"minProximity": undefined, | ||
"minWordSizefor1Typo": undefined, | ||
"minWordSizefor2Typos": undefined, | ||
"minimumAroundRadius": undefined, | ||
"numericFilters": undefined, | ||
"numericRefinements": Object {}, | ||
"offset": undefined, | ||
"optionalFacetFilters": undefined, | ||
"optionalTagFilters": undefined, | ||
"optionalWords": undefined, | ||
"page": 0, | ||
"query": "", | ||
"queryType": undefined, | ||
"removeWordsIfNoResults": undefined, | ||
"replaceSynonymsInHighlight": undefined, | ||
"restrictSearchableAttributes": undefined, | ||
"snippetEllipsisText": undefined, | ||
"synonyms": undefined, | ||
"tagFilters": undefined, | ||
"tagRefinements": Array [], | ||
"typoTolerance": undefined, | ||
} | ||
`; | ||
|
||
exports[`instantsearch widget routing getWidgetSearchParameters should reset aroundLatLng if no defaultOptions and no value is in the UI State 1`] = ` | ||
SearchParameters { | ||
"advancedSyntax": undefined, | ||
"allowTyposOnNumericTokens": undefined, | ||
"analytics": undefined, | ||
"analyticsTags": undefined, | ||
"aroundLatLng": undefined, | ||
"aroundLatLngViaIP": undefined, | ||
"aroundPrecision": undefined, | ||
"aroundRadius": undefined, | ||
"attributesToHighlight": undefined, | ||
"attributesToRetrieve": undefined, | ||
"attributesToSnippet": undefined, | ||
"disableExactOnAttributes": undefined, | ||
"disjunctiveFacets": Array [], | ||
"disjunctiveFacetsRefinements": Object {}, | ||
"distinct": undefined, | ||
"enableExactOnSingleWordQuery": undefined, | ||
"facets": Array [], | ||
"facetsExcludes": Object {}, | ||
"facetsRefinements": Object {}, | ||
"getRankingInfo": undefined, | ||
"hierarchicalFacets": Array [], | ||
"hierarchicalFacetsRefinements": Object {}, | ||
"highlightPostTag": undefined, | ||
"highlightPreTag": undefined, | ||
"hitsPerPage": undefined, | ||
"ignorePlurals": undefined, | ||
"index": "", | ||
"insideBoundingBox": undefined, | ||
"insidePolygon": undefined, | ||
"length": undefined, | ||
"maxValuesPerFacet": undefined, | ||
"minProximity": undefined, | ||
"minWordSizefor1Typo": undefined, | ||
"minWordSizefor2Typos": undefined, | ||
"minimumAroundRadius": undefined, | ||
"numericFilters": undefined, | ||
"numericRefinements": Object {}, | ||
"offset": undefined, | ||
"optionalFacetFilters": undefined, | ||
"optionalTagFilters": undefined, | ||
"optionalWords": undefined, | ||
"page": 0, | ||
"query": "", | ||
"queryType": undefined, | ||
"removeWordsIfNoResults": undefined, | ||
"replaceSynonymsInHighlight": undefined, | ||
"restrictSearchableAttributes": undefined, | ||
"snippetEllipsisText": undefined, | ||
"synonyms": undefined, | ||
"tagFilters": undefined, | ||
"tagRefinements": Array [], | ||
"typoTolerance": undefined, | ||
} | ||
`; |
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
Oops, something went wrong.