This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
fix(panel): safely access state in mapStateToCanRefine #876
Merged
Conversation
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
Haroenv
commented
Oct 1, 2020
@@ -2,7 +2,7 @@ | |||
|
|||
exports[`allows search bar classes override when it's searchable 1`] = ` | |||
|
|||
<div class="ais-RefinementList ais-RefinementList--noRefinement"> | |||
<div class="ais-RefinementList"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because the test used to be wrong (didn't pass canRefine
in defaultState)
eunjae-lee
reviewed
Oct 2, 2020
eunjae-lee
approved these changes
Oct 2, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙌
Co-authored-by: Eunjae Lee <eunjae.lee@algolia.com>
yannickcr
approved these changes
Oct 2, 2020
Haroenv
commented
Oct 2, 2020
Haroenv
added a commit
to algolia/instantsearch
that referenced
this pull request
Dec 28, 2022
…nstantsearch#876) Most of the widgets were assuming the shape of state is always "right", but since algolia/vue-instantsearch#871 it is also called with an empty object. This PR does the following things: - changes all widgets to work correctly with empty object - makes sure always a boolean is returned from mapStateToCanRefine to make tests easier - make tests of mapStateToCanRefine consistent, as well as adding a unit test to each of the methods using {} as state closes algolia/vue-instantsearch#875 fixes algolia/vue-instantsearch#874
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most of the widgets were assuming the shape of state is always "right", but since #871 it is also called with an empty object. This PR does the following things:
{}
as statecloses #875
fixes #874